summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorge Hernandez <jh1730@att.com>2018-03-09 16:11:08 +0000
committerGerrit Code Review <gerrit@onap.org>2018-03-09 16:11:08 +0000
commit5805752884388261d7183e88a8ae633ebf3a46d6 (patch)
treeb8f7792a88a3c632461bf55e0167a23a7da358f2
parent76f11353eb304c90fd935175847ac30ec7e5bb6f (diff)
parentc4d332355b0b2b2463c586e8934cfe55dea0ec00 (diff)
Merge "Policy:Blocker"
-rw-r--r--BRMSGateway/src/main/java/org/onap/policy/brmsInterface/BRMSPush.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/BRMSGateway/src/main/java/org/onap/policy/brmsInterface/BRMSPush.java b/BRMSGateway/src/main/java/org/onap/policy/brmsInterface/BRMSPush.java
index b76812b00..fd864fded 100644
--- a/BRMSGateway/src/main/java/org/onap/policy/brmsInterface/BRMSPush.java
+++ b/BRMSGateway/src/main/java/org/onap/policy/brmsInterface/BRMSPush.java
@@ -571,14 +571,17 @@ public class BRMSPush {
String fileName = "rule.jar";
try {
website = new URL(artifact.getResourceURI());
- ReadableByteChannel rbc = Channels.newChannel(website.openStream());
- FileOutputStream fos = new FileOutputStream(fileName);
- fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
- fos.close();
- extractJar(fileName, dirName);
- new File(fileName).delete();
- } catch (IOException e) {
- LOGGER.error("Error while downloading the project to File System. " + e.getMessage(), e);
+ try( ReadableByteChannel rbc = Channels.newChannel(website.openStream());
+ FileOutputStream fos = new FileOutputStream(fileName)){
+ fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
+ extractJar(fileName, dirName);
+ new File(fileName).delete();
+ }catch (IOException e) {
+ LOGGER.error("Error while downloading the project to File System. " + e.getMessage(), e);
+ }
+
+ } catch (IOException e1) {
+ LOGGER.error("Error while retrieve the artifact. " + e1.getMessage(), e1);
}
}