}
 
     public static String addTime(String srcTimeString, String period) throws ParseException {
-       try{
-               String finaldate = getTimeString(srcTimeString);
-               SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-               Date date = sdf.parse(finaldate);
-               Calendar calendar = Calendar.getInstance();
-               calendar.setTime(date);
-               calendar.add(Calendar.MINUTE, Integer.valueOf(period));
-               return sdf.format(calendar.getTime());
-       }catch( ParseException e){
-               throw e;
-       }
-       
+           String finaldate = getTimeString(srcTimeString);
+           SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+           Date date = sdf.parse(finaldate);
+           Calendar calendar = Calendar.getInstance();
+           calendar.setTime(date);
+           calendar.add(Calendar.MINUTE, Integer.valueOf(period));
+           return sdf.format(calendar.getTime());
     }
 
 }
 
 
     public abstract void dispose();
 
-    final public void run() {
+    public final void run() {
         t = Thread.currentThread();
         if (name != null)
             t.setName(name);
         try {
             dispose();
         } catch (Exception e) {
-            //e.printStackTrace();
            log.error(" printStackTrace :", e);
         }
         this.setEnd(true);
 
                                moveBytes(gzIn, fileOutput, -1, -1, 1024);
                        } 
                }catch(IOException e){
-               throw e;
+                       throw new IOException ("Gunzip", e);
                }
 
        }
        }
 
        public long moveBytes(InputStream input, OutputStream output, long off, long len, int bufsize) throws IOException {
-               long skipped=0;
-               if (off > 0)
+               /*      long skipped=0;
+                       if (off > 0)
                        skipped = input.skip(off); // check if skipped is same as off
-
+               */
                long totalNum = 0;
                byte[] buf = new byte[bufsize];
 
                        output.write(buf, 0, readNum);
                        totalNum += readNum;
                }
-               buf = null;
                return totalNum;
        }
 
 
     }
 
     public static boolean isBank(String str) {
-        if (str == null || str.trim().length() == 0) {
-
-            return true;
-        }
-        return false;
+           return (str == null || str.trim().length() == 0); 
     }
 }
 
                 }
             }
         } catch (IOException e) {
-            throw e;
+            throw new IOException("deCompress: ",e);
         }  
    }
 
     protected void deCompressFile(InputStream input, String toPath)
             throws IOException {
-        byte byteBuf[] = new byte[2048];
+        byte[] byteBuf = new byte[2048];
         String path = new File(toPath).getParent();
         if (!new File(path).exists()) {
             new File(path).mkdirs();
         }
-        FileOutputStream output = new FileOutputStream(toPath, false);
-        try {
+        try(FileOutputStream output = new FileOutputStream(toPath, false)){
             for (int count = 0; (count = input.read(byteBuf, 0, byteBuf.length)) != -1; )
                 output.write(byteBuf, 0, count);
         } catch (IOException e) {
-            throw e;
-        } finally {
-            output.close();
-            input.close();
-        }
+            throw new IOException ("deCompressFile: ", e);
+        } 
     }
 }
 
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-final public class VarExprParser {
+    public  final class VarExprParser {
     private static Log log = LogFactory.getFactory().getInstance(VarExprParser.class);
     private static Pattern varPattern = Pattern.compile("(\\$\\{([^\\}]+)\\})",
             Pattern.CASE_INSENSITIVE);
 
-    final static public String replaceVar(String str, long scan_start_time, long scan_stop_time) {
+    public static final String replaceVar(String str, long scanStartTime, long scanStopTime) {
         if (str.indexOf("${") == -1)
             return str;
 
         str = str.replace("${e_hour}", "${SCAN_STOP_TIME,HH}");
         str = str.replace("${e_min}", "${SCAN_STOP_TIME,mm}");
 
-        String expr = null, varName = null, value = null;
+        String expr, varName, value ;
         Matcher matcher = varPattern.matcher(str);
         while (matcher.find()) {
             value = null;
             expr = matcher.group(1);
             varName = matcher.group(2);
             if (expr.indexOf("${SCAN_START_TIME") != -1) {
-                value = getTime(scan_start_time, varName, "yyyy-MM-dd HH:mm:ss");
+                value = getTime(scanStartTime, varName, "yyyy-MM-dd HH:mm:ss");
             } else if (expr.indexOf("${SCAN_STOP_TIME") != -1) {
-                value = getTime(scan_stop_time, varName, "yyyy-MM-dd HH:mm:ss");
+                value = getTime(scanStopTime, varName, "yyyy-MM-dd HH:mm:ss");
             }
             if (value == null) {
                 log.warn(" expr [" + str + "] var["
             }
             str = str.replace(expr, value);
         }
-        expr = value = null;
-        matcher = null;
         return str;
     }
 
     /**
      * Support two variable substitutions
      * @param result
-     * @param scan_start_time
-     * @param scan_stop_time
+     * @param scanStartTime
+     * @param scanStopTime
      * @return
      */
-    public static String replaceTimeVar(String result,String scan_start_time, String scan_stop_time) {
+    public static String replaceTimeVar(String result,String scanStartTime, String scanStopTime) {
         boolean isReplace = false;
         if (result.indexOf("${SCAN_ST") != -1) {
             isReplace = true;
         if (isReplace) {
             if (result.indexOf("${SCAN_START_TIME}") != -1) {
 
-                result = StringUtils.replace(result, "${SCAN_START_TIME}", scan_start_time);
+                result = StringUtils.replace(result, "${SCAN_START_TIME}", scanStartTime);
             }
             if (result.indexOf("${SCAN_STOP_TIME") != -1) {
 
-                result = StringUtils.replace(result, "${SCAN_STOP_TIME}", scan_stop_time);
+                result = StringUtils.replace(result, "${SCAN_STOP_TIME}", scanStopTime);
             }
         }
         return result;
 
 
 public class XmlUtil {
 
-    public static Document getDocument(InputStream is) throws XMLStreamException, JDOMException, IOException {
-        SAXBuilder builder = new SAXBuilder();
-        Document doc = builder.build(is);
-        return doc;
-    }
+       public static Document getDocument(InputStream is) throws JDOMException, IOException {
+               SAXBuilder builder = new SAXBuilder();
+               return builder.build(is);
+       }
 }
 
         if (directoryPath.isFile()) {
             compressFile(directoryPath.getAbsolutePath());
         } else {
-            File listFiles[] = directoryPath.listFiles();
+            File[] listFiles = directoryPath.listFiles();
             for (int i = 0; i < listFiles.length; i++)
                 if (listFiles[i].isFile()) {
                     compressFile(listFiles[i].getAbsolutePath());
     }
 
     protected void compressFile(String absolutePath) throws IOException {
-           try{
-                   compressFileCount++;
-                   byte byteBuf[] = new byte[2048];
-                   zipOutput.putNextEntry(new ZipEntry(absolutePath.substring(relativeAddrIdx)));
-                   FileInputStream input = new FileInputStream(absolutePath);
-                   try{
-                           for (int count = 0; (count = input.read(byteBuf, 0, byteBuf.length)) != -1; )
-                                   zipOutput.write(byteBuf, 0, count);
-                   }finally{
-                           input.close();
-                           zipOutput.closeEntry();
-                   }
-           }catch(IOException e){
-                   throw e;    
-           }           
+           compressFileCount++;
+           byte[] byteBuf = new byte[2048];
+           zipOutput.putNextEntry(new ZipEntry(absolutePath.substring(relativeAddrIdx)));
+
+           try( FileInputStream input = new FileInputStream(absolutePath)){
+                   for (int count = 0; (count = input.read(byteBuf, 0, byteBuf.length)) != -1; )
+                           zipOutput.write(byteBuf, 0, count);
+           }finally{
+                   zipOutput.closeEntry();
+           }
     }
 
     public void setCompressLevel(int level) {