1   String path= ApplicationConfigure.getProperty("rootPath");
 2   clearFiles(path+File.separator+id);    
 3   //删除磁盘上文件和目录
 4   private void clearFiles(String workspaceRootPath){
 5         File file = new File(workspaceRootPath);
 6         deleteFile(file);
 7     }
 8     
 9     private void deleteFile(File file){
10         if(file.exists()){
11             if(file.isDirectory()){
12                  File[] files = file.listFiles();
13                  for(int i=0; i<files.length; i++){
14                      deleteFile(files[i]);
15                  }
16             }
17         }
18         file.delete();
19      }
20             

 

相关文章:

  • 2021-12-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-18
  • 2021-10-17
  • 2022-12-23
相关资源
相似解决方案