aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-tosca-lib
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2017-04-14 13:28:20 -0700
committerGary Wu <gary.i.wu@huawei.com>2017-07-18 13:12:32 -0700
commit4970625eaa858c0ab84d04e0306882fb8c8ba743 (patch)
tree9af760bf48d87590f57c869de15243244efbdcdf /openecomp-be/lib/openecomp-tosca-lib
parentb8e2faf476202b6ffe61bc3a9a37df1304881d40 (diff)
Replace FileUtils.toByteArray() with IOUtils
The in-house implementation of FileUtils.toByteArray() appears to be a literal copy-and-paste of IOUtils.toByteArray(). This change replaces the in-house implementation with a call to IOUtils. Change-Id: Ib33b64c4c0050acb0787915dd9df190e284b8cda Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-tosca-lib')
-rw-r--r--openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImpl.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImpl.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImpl.java
index b518057e35..9a3ed8e73f 100644
--- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImpl.java
+++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImpl.java
@@ -20,6 +20,7 @@
package org.openecomp.sdc.tosca.services.impl;
+import org.apache.commons.io.IOUtils;
import org.openecomp.core.utilities.file.FileContentHandler;
import org.openecomp.core.utilities.file.FileUtils;
import org.openecomp.sdc.common.errors.CoreException;
@@ -176,6 +177,8 @@ public class ToscaFileOutputServiceCsarImpl implements ToscaFileOutputService {
}
private void writeBytesToZip(ZipOutputStream zos, InputStream is) throws IOException {
- FileUtils.copy(is, zos);
+ if(is != null){
+ IOUtils.copy(is, zos);
+ }
}
}