From 37945bf2f9b95a4c24ccc6ba09c2132c406c8f7e Mon Sep 17 00:00:00 2001 From: Murali-P Date: Thu, 8 Mar 2018 14:42:01 +0530 Subject: Improve code coverage Code coverage is less than 50% Issue-ID: VNFSDK-159 Change-Id: Icf972fbc3754c3bfd495e5786fea53fbdf9c3fd5 Signed-off-by: Murali-P --- .../onap/vnfsdk/marketplace/common/FileUtil.java | 61 +--------------------- 1 file changed, 1 insertion(+), 60 deletions(-) (limited to 'vnfmarket-be') diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/common/FileUtil.java b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/common/FileUtil.java index a5ca6ac1..073bb3eb 100644 --- a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/common/FileUtil.java +++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/common/FileUtil.java @@ -21,7 +21,6 @@ import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; -import java.io.OutputStream; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; @@ -48,7 +47,7 @@ public final class FileUtil { private static final int TRY_COUNT = 3; private FileUtil() { - // Empty constructor + //Empty constructor } /** @@ -139,64 +138,6 @@ public final class FileUtil { return unzipFileNams; } - /** - * close InputStream. - * - * @param inputStream - * the inputstream to close - */ - public static void closeInputStream(InputStream inputStream) { - try { - if (inputStream != null) { - inputStream.close(); - } - } catch (Exception e1) { - logger.info("error while closing InputStream!", e1); - } - } - - /** - * close OutputStream. - * - * @param outputStream - * the output stream to close - */ - public static void closeOutputStream(OutputStream outputStream) { - try { - if (outputStream != null) { - outputStream.close(); - } - } catch (Exception e1) { - logger.info("error while closing OutputStream!", e1); - } - } - - public static void closeFileStream(FileInputStream ifs) { - try { - if (ifs != null) { - ifs.close(); - } - } catch (Exception e1) { - logger.info("error while closing OutputStream", e1); - } - } - - /** - * close zipFile. - * - * @param zipFile - * the zipFile to close - */ - public static void closeZipFile(ZipFile zipFile) { - try { - if (zipFile != null) { - zipFile.close(); - } - } catch (IOException e1) { - logger.info("close ZipFile error!", e1); - } - } - public static boolean checkFileExists(String filePath) { File file = new File(filePath); return file.exists(); -- cgit 1.2.3-korg