import java.io.BufferedInputStream;
 import java.io.BufferedOutputStream;
 import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
-import java.io.IOException;
 import java.io.InputStream;
 import java.util.Enumeration;
 import java.util.zip.ZipEntry;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import net.sf.json.JSONArray;
-import net.sf.json.JSONObject;
 
 /**
  * Utility class to download CSAR
             }
            }
             is.close();
-            //fileout.flush();
-            //fileout.close();
             status = Constant.DOWNLOADCSAR_SUCCESS;
 
         } catch (Exception e) {
     public static int unzipCSAR(String fileName,String filePath){
        final int BUFFER = 2048;
        int status=0;
-       
-        try ( ZipFile zipFile = new ZipFile(fileName)){
+        try (ZipFile zipFile = new ZipFile(fileName)){
             Enumeration emu = zipFile.entries();
-            int i=0;
             while(emu.hasMoreElements()){
                 ZipEntry entry = (ZipEntry)emu.nextElement();
                 //read directory as file first,so only need to create directory
                     parent.mkdirs();
                 }
                 try(FileOutputStream fos = new FileOutputStream(file);
-                BufferedOutputStream bos = new BufferedOutputStream(fos,BUFFER)){           
-                
-                int count;
-                byte data[] = new byte[BUFFER];
-                while ((count = bis.read(data, 0, BUFFER)) != -1)
-                {
-                    bos.write(data, 0, count);
-                }
+                   BufferedOutputStream bos = new BufferedOutputStream(fos,BUFFER)){ 
+                       int count;
+                       byte[] data = new byte[BUFFER];
+                       while ((count = bis.read(data, 0, BUFFER)) != -1)
+                       {
+                               bos.write(data, 0, count);
+                       }
                }
-                //bos.flush();
-                //bos.close();
                 bis.close();
 
                 if(entry.getName().endsWith(".zip")){
             zipFile.close();
         } catch (Exception e) {
                status=Constant.UNZIP_FAIL;
-            //e.printStackTrace();
                LOG.error("unzipCSAR Exception: ",e);
 
         }
         return csarfilepath;
     }
     public static void main(String[] args) {
-        System.out.println(getImagesPath("e:/juju/csar2/"));
+        LOG.info("AbsolutePath: " + getImagesPath("e:/juju/csar2/"));
     }
 }
 
-/*
+/**
  * Copyright 2016 Huawei Technologies Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
 
                    int byteread = 0;
                    File oldfile = new File(oldPath);
                    if (oldfile.exists()) {
-                           if (flag == false) {
+                           if (!flag) {
                                    delFiles(newPath);
                            }
-                           if (new File(newPath).exists() && flag == true) {
+                           if (new File(newPath).exists() && flag) {
                                    return;
                            }
                            newFile(newPath);
                                            fos.write(buffer, 0, byteread);
                                    }
                            }
-                           //fos.close();
-                           //fis.close();
                    } else {
                            throw new FileNotFoundException("the " + oldfile + " is not exits ");
                    }
             return true;
         if (myDelFile.isDirectory()) {
             File[] fs = myDelFile.listFiles();
-            for (int i = 0; i < fs.length; i++) {
+            for (int i = 0; i < fs.length; i++) {//no need to assign
                 if (fs[i].isFile())
-                    flag = fs[i].delete();
+                    fs[i].delete();
                 if (fs[i].isDirectory()) {
-                    flag = delFiles(fs[i].getAbsolutePath());
-                    flag = fs[i].delete();
+                    delFiles(fs[i].getAbsolutePath());
+                    fs[i].delete();
                 }
             }
         }
      * */
     public static List<File> getFiles(String path) {
 
-        List<File> list = new ArrayList<File>();
+        List<File> list = new ArrayList<>();
         File file = new File(path);
         if (!file.exists()) {
 
 
-/*
+/**
  * Copyright 2016 Huawei Technologies Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * @version NFVO 0.5 Sep 19, 2016
  */
 public class LocalComandUtils {
+    private static final Logger log = LoggerFactory.getLogger(LocalComandUtils.class);
+
     private LocalComandUtils(){
         
     }
 
-    private static final Logger log = LoggerFactory.getLogger(LocalComandUtils.class);
-
-
     /**
      * <br>
      * 
 
-/*
+/**
  * Copyright (c) 2016, Huawei Technologies Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
-import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 
     private static Logger log = LoggerFactory.getLogger(UnCompressUtil.class);
 
-    private static Map<String, String> archiveMap = new HashMap<String, String>();
+    private static Map<String, String> archiveMap = new HashMap<>();
 
-    private static Map<String, String> compressorMap = new HashMap<String, String>();
+    private static Map<String, String> compressorMap = new HashMap<>();
 
     static {
         // archive type
                     FileUtils.mkDirs(fileName);
                 } else {
                     int count;
-                    byte data[] = new byte[2048];
+                    byte[] data = new byte[2048];
                     File file = getRealFileName(targetPath, name);
                     fileNames.add(file.getName());
 
 
         if(data == null) {
             return "";
         }
-        ByteArrayInputStream input = null;
-        GZIPInputStream gzis = null;
-        InputStreamReader reader = null;
         final StringBuilder out = new StringBuilder();
-        try {
-            input = new ByteArrayInputStream(data);
-            gzis = new GZIPInputStream(input);
-            reader = new InputStreamReader(gzis, Charset.forName(RestfulClientConst.ENCODING));
+       try (
+           ByteArrayInputStream    input = new ByteArrayInputStream(data);
+           GZIPInputStream  gzis = new GZIPInputStream(input);
+           InputStreamReader reader = new InputStreamReader(gzis, Charset.forName(RestfulClientConst.ENCODING))){
             final char[] buff = new char[1024];
             for(int n; (n = reader.read(buff)) != -1;) {
                 out.append(new String(buff, 0, n));
             }
-        } finally {
-            if(reader != null) {
-                try {
-                    reader.close();
-                } catch(final IOException e) {
-                    LOGGER.error("decompress Gzip reader exception:", e);
-                }
-            }
-            if(gzis != null) {
-                try {
-                    gzis.close();
-                } catch(final IOException e) {
-                    LOGGER.error("decompress Gzip exception:", e);
-                }
-            }
-            if(input != null) {
-                try {
-                    input.close();
-                } catch(final IOException e) {
-                    LOGGER.error("decompress Gzip input exception:", e);
-                }
-            }
-        }
+        } 
         return out.toString();
 
     }