示例#1
0
 public static void clear(String fileStr) throws Exception {
   File file = new File(fileStr);
   if (file.isFile()) {
     file.delete();
     return;
   }
   String[] fileNames = file.list();
   if (fileNames == null) {
     return;
   }
   for (int i = 0; i < fileNames.length; i++) {
     String newFileName = GlobalFile.getFileLocation(fileStr, fileNames[i]);
     clear(newFileName);
   }
   file.delete();
 }
示例#2
0
 public static void copyFile(String imgFile, String origFile) throws Exception {
   String fileContent = GlobalFile.getStringFromFile(origFile);
   GlobalFile.saveStringToFile(fileContent, imgFile);
 }