@@ -0,0 +1,1120 @@
+package com.dw.lib.cli;%0A%0Aimport java.io.IOException;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport com.dw.lib.FileUtils;%0A%0Apublic class CppCpCLI %7B%0A%0A%09public static void help() %7B%0A%09%09System.out.println(%22cppcp  %3Cinput file%3E %3Coutput folder%3E %3Cfinal-file%3E%22);%0A%09%7D%0A%09%0A%09public static void main(String%5B%5D args) %7B%0A%09%09// TODO Auto-generated method stub%0A%09%09if(args.length != 3) %7B%0A%09%09%09help();%0A%09%09%09return;%0A%09%09%7D%0A%09%09%0A%09%09FileUtils fileUtils = new FileUtils();%0A%09%09String mainPath = args%5B1%5D;%0A%09%09StringBuilder sb = new StringBuilder();%0A%09%09List%3CString%3E output = new ArrayList%3CString%3E();%0A%09%09try %7B%0A%09%09%09List%3CString%3E lines = fileUtils.fileToList(args%5B0%5D);%0A%09%09%09%0A%09%09%09for(String line : lines) %7B%0A%09%09%09%09String%5B%5D paths = line.split(%22/%22);%0A%09%09%09%09sb.append(mainPath);%0A%09%09%09%09for(int i=0;i%3Cpaths.length-1;i++) %7B%0A%09%09%09%09%09if(!paths%5Bi%5D.equals(%22.%22))%0A%09%09%09%09%09%09sb.append(paths%5Bi%5D + %22/%22);%0A%09%09%09%09%7D%0A%09%09%09%09output.add(%22mkdir -p %22 + sb.toString());%0A%09%09%09%09output.add(%22cp %22 + line + %22 %22 + sb.append(paths%5Bpaths.length-1%5D));%0A%09%09%09%09sb.setLength(0);%0A%09%09%09%7D%0A%09%09%09%0A%09%09%09fileUtils.listToFile(output, args%5B2%5D);%0A%09%09%7D catch (IOException e) %7B%0A%09%09%09// TODO Auto-generated catch block%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%09%7D%0A%0A%7D%0A

add cppcp cli