Page 1 of 1

Delete all files and directories of specific directory

PostPosted: Wed May 14, 2014 3:42 pm
by Development@SIB
If you want to delete all files and directories of a specific directory - with JVx - check following snippet:

Code: Select all
String sTmp = System.getProperty("java.io.tmpdir");
   
File fi = new File(sTmp, "myapp");
fi.mkdirs();
   
//create temporary files
   
FileUtil.deleteSub(fi);
//or
//FileUtil.delete(fi);