Ejemplo n.º 1
0
 public void delete() {
   if (delfile != null) {
     this.getInsertDB().delShareFile(this.delfile);
     String realpath = ServletActionContext.getRequest().getRealPath(inputPath);
     File file = new File(realpath + "\\" + delfile);
     if (file != null) {
       file.delete();
     }
   }
 }
Ejemplo n.º 2
0
 public static void deleteIfExists(File file) {
   if (file.exists()) file.delete();
 }
Ejemplo n.º 3
0
 public static void deleteDirectory(File f) throws IOException {
   if (f.isDirectory()) {
     for (File c : f.listFiles()) deleteDirectory(c);
   }
   if (!f.delete()) throw new FileNotFoundException("Failed to delete file: " + f);
 }