@Test public void test_call_upper(){ String oldPath = "D:\\0000_test\\updiff\\abacus\\abacus-product-bootstrap-1.0.0"; String newPath = "D:\\0000_test\\updiff\\abacus\\abacus-product-bootstrap-1.0.0-assembly.new.tar.gz"; Upper.main(new String[]{"up", oldPath, newPath}); }
public static void main(String[] args){ if(args == null || args.length == 0){ printUsage(); return; } try { Upper upper = null; boolean isScussess = false; if("up".equals(args[0]) && args.length == 3){ upper = new Upper(args[1], args[2]); isScussess = upper.up(); } else if("backup".equals(args[0]) && (args.length == 3 || args.length == 4)){ if(args.length == 3){ upper = new Upper(args[1], args[2]); } else if(args.length == 4){ upper = new Upper(args[1], args[2], args[3]); } isScussess = upper.backup(); } else if("recovery".equals(args[0]) && args.length == 2){ isScussess = recovery(args[1]); } else { LOGGER.error(String.format("用法错误： %s ", getCommond(args))); printUsage(); return; } if(isScussess){ LOGGER.info(String.format("更新成功： %s", getCommond(args))); } else { LOGGER.error(String.format("更新失败： %s", getCommond(args))); } } catch (Exception e){ LOGGER.error("出错：", e); } }
Upper { public static void main(String[] args){ if(args == null || args.length == 0){ printUsage(); return; } try { Upper upper = null; boolean isScussess = false; if("up".equals(args[0]) && args.length == 3){ upper = new Upper(args[1], args[2]); isScussess = upper.up(); } else if("backup".equals(args[0]) && (args.length == 3 || args.length == 4)){ if(args.length == 3){ upper = new Upper(args[1], args[2]); } else if(args.length == 4){ upper = new Upper(args[1], args[2], args[3]); } isScussess = upper.backup(); } else if("recovery".equals(args[0]) && args.length == 2){ isScussess = recovery(args[1]); } else { LOGGER.error(String.format("用法错误： %s ", getCommond(args))); printUsage(); return; } if(isScussess){ LOGGER.info(String.format("更新成功： %s", getCommond(args))); } else { LOGGER.error(String.format("更新失败： %s", getCommond(args))); } } catch (Exception e){ LOGGER.error("出错：", e); } } }
Upper { public static void main(String[] args){ if(args == null || args.length == 0){ printUsage(); return; } try { Upper upper = null; boolean isScussess = false; if("up".equals(args[0]) && args.length == 3){ upper = new Upper(args[1], args[2]); isScussess = upper.up(); } else if("backup".equals(args[0]) && (args.length == 3 || args.length == 4)){ if(args.length == 3){ upper = new Upper(args[1], args[2]); } else if(args.length == 4){ upper = new Upper(args[1], args[2], args[3]); } isScussess = upper.backup(); } else if("recovery".equals(args[0]) && args.length == 2){ isScussess = recovery(args[1]); } else { LOGGER.error(String.format("用法错误： %s ", getCommond(args))); printUsage(); return; } if(isScussess){ LOGGER.info(String.format("更新成功： %s", getCommond(args))); } else { LOGGER.error(String.format("更新失败： %s", getCommond(args))); } } catch (Exception e){ LOGGER.error("出错：", e); } } Upper(String oldPath, String newPath);  Upper(String oldPath, String newPath, String backupDir); }
Upper { public static void main(String[] args){ if(args == null || args.length == 0){ printUsage(); return; } try { Upper upper = null; boolean isScussess = false; if("up".equals(args[0]) && args.length == 3){ upper = new Upper(args[1], args[2]); isScussess = upper.up(); } else if("backup".equals(args[0]) && (args.length == 3 || args.length == 4)){ if(args.length == 3){ upper = new Upper(args[1], args[2]); } else if(args.length == 4){ upper = new Upper(args[1], args[2], args[3]); } isScussess = upper.backup(); } else if("recovery".equals(args[0]) && args.length == 2){ isScussess = recovery(args[1]); } else { LOGGER.error(String.format("用法错误： %s ", getCommond(args))); printUsage(); return; } if(isScussess){ LOGGER.info(String.format("更新成功： %s", getCommond(args))); } else { LOGGER.error(String.format("更新失败： %s", getCommond(args))); } } catch (Exception e){ LOGGER.error("出错：", e); } } Upper(String oldPath, String newPath);  Upper(String oldPath, String newPath, String backupDir); boolean up(); boolean backup(); static boolean recovery(String backupDir); static void main(String[] args); }
Upper { public static void main(String[] args){ if(args == null || args.length == 0){ printUsage(); return; } try { Upper upper = null; boolean isScussess = false; if("up".equals(args[0]) && args.length == 3){ upper = new Upper(args[1], args[2]); isScussess = upper.up(); } else if("backup".equals(args[0]) && (args.length == 3 || args.length == 4)){ if(args.length == 3){ upper = new Upper(args[1], args[2]); } else if(args.length == 4){ upper = new Upper(args[1], args[2], args[3]); } isScussess = upper.backup(); } else if("recovery".equals(args[0]) && args.length == 2){ isScussess = recovery(args[1]); } else { LOGGER.error(String.format("用法错误： %s ", getCommond(args))); printUsage(); return; } if(isScussess){ LOGGER.info(String.format("更新成功： %s", getCommond(args))); } else { LOGGER.error(String.format("更新失败： %s", getCommond(args))); } } catch (Exception e){ LOGGER.error("出错：", e); } } Upper(String oldPath, String newPath);  Upper(String oldPath, String newPath, String backupDir); boolean up(); boolean backup(); static boolean recovery(String backupDir); static void main(String[] args);  }