summaryrefslogtreecommitdiffstats
path: root/vnf-sdk-function-test/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'vnf-sdk-function-test/src/main')
-rw-r--r--vnf-sdk-function-test/src/main/java/org/openo/vnfsdk/functest/resource/CommonManager.java4
-rw-r--r--vnf-sdk-function-test/src/main/java/org/openo/vnfsdk/functest/util/ZipCompressor.java9
2 files changed, 6 insertions, 7 deletions
diff --git a/vnf-sdk-function-test/src/main/java/org/openo/vnfsdk/functest/resource/CommonManager.java b/vnf-sdk-function-test/src/main/java/org/openo/vnfsdk/functest/resource/CommonManager.java
index 3fef44e..41c4391 100644
--- a/vnf-sdk-function-test/src/main/java/org/openo/vnfsdk/functest/resource/CommonManager.java
+++ b/vnf-sdk-function-test/src/main/java/org/openo/vnfsdk/functest/resource/CommonManager.java
@@ -101,9 +101,7 @@ public class CommonManager {
});
// Send REST response
- Response response = RestResponseUtil.getSuccessResponse(uniqueKey);
-
- return response;
+ return RestResponseUtil.getSuccessResponse(uniqueKey);
} catch(IOException e) {
LOGGER.error("Upload the script and execute the script and run command", e);
diff --git a/vnf-sdk-function-test/src/main/java/org/openo/vnfsdk/functest/util/ZipCompressor.java b/vnf-sdk-function-test/src/main/java/org/openo/vnfsdk/functest/util/ZipCompressor.java
index 02a0609..0ab292c 100644
--- a/vnf-sdk-function-test/src/main/java/org/openo/vnfsdk/functest/util/ZipCompressor.java
+++ b/vnf-sdk-function-test/src/main/java/org/openo/vnfsdk/functest/util/ZipCompressor.java
@@ -90,9 +90,10 @@ public class ZipCompressor {
if(!file.exists()) {
return;
}
- try {
+ try (BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file))) {
+
byte data[] = new byte[BUFFER];
- BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
+
ZipEntry entry = new ZipEntry(basedir + file.getName());
out.putNextEntry(entry);
int count;
@@ -100,8 +101,8 @@ public class ZipCompressor {
out.write(data, 0, count);
}
bis.close();
- } catch(Exception e1) {
- throw new RuntimeException(e1);
+ } catch(IOException e) {
+ LOG.info("Exception wile compress file" + file.getAbsolutePath(), e);
}
}
}