Code Review
/
policy
/
engine.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
[Policy-8 ,Policy-23] Updated Matchid for policies
[policy/engine.git]
/
ECOMP-PAP-REST
/
src
/
main
/
java
/
org
/
openecomp
/
policy
/
pap
/
xacml
/
rest
/
service
/
ImportService.java
diff --git
a/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/service/ImportService.java
b/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/service/ImportService.java
index
d70332e
..
0b3e313
100644
(file)
--- a/
ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/service/ImportService.java
+++ b/
ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/service/ImportService.java
@@
-95,10
+95,8
@@
public class ImportService {
}
}else{
InputStream inputStream = null;
}
}else{
InputStream inputStream = null;
- FileOutputStream outputStream = null;
- try {
+ try(FileOutputStream outputStream = new FileOutputStream("ExtractDir" + File.separator + randomID+".zip")) {
inputStream = request.getInputStream();
inputStream = request.getInputStream();
- outputStream = new FileOutputStream("ExtractDir" + File.separator + randomID+".zip");
byte[] buffer = new byte[4096];
int bytesRead = -1 ;
while ((bytesRead = inputStream.read(buffer)) != -1) {
byte[] buffer = new byte[4096];
int bytesRead = -1 ;
while ((bytesRead = inputStream.read(buffer)) != -1) {
@@
-112,9
+110,6
@@
public class ImportService {
if(inputStream != null){
inputStream.close();
}
if(inputStream != null){
inputStream.close();
}
- if(outputStream != null){
- outputStream.close();
- }
} catch (IOException e) {
PolicyLogger.error("Exception Occured while closing the input/output stream"+e);
}
} catch (IOException e) {
PolicyLogger.error("Exception Occured while closing the input/output stream"+e);
}