Leafref and identityref types to Json
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / test / java / org / opendaylight / controller / sal / restconf / impl / test / TestUtils.java
index 89d24ad0579b9b78a77a68f121d8f13ca75ef399..61942e81a6e5918689cb4e77d1c9758b94b85911 100644 (file)
@@ -211,10 +211,12 @@ final class TestUtils {
                 null, byteArrayOS);
 
         jsonResult = byteArrayOS.toString();
-        try {
-            outputToFile(byteArrayOS, outputPath);
-        } catch (IOException e) {
-            System.out.println("Output file wasn't cloased sucessfuly.");
+        if (outputPath != null) {
+            try {            
+                outputToFile(byteArrayOS, outputPath);
+            } catch (IOException e) {
+                System.out.println("Output file wasn't cloased sucessfuly.");
+            }
         }
 
         return jsonResult;