code: private void deleteFile(File file, String vfsName) {
  
          try {
              if (file.exists() && file.canWrite()) {
                  file.delete();
                  // write log message
                  if (LOG.isInfoEnabled()) {
                      LOG.info(Messages.get().getBundle().key(Messages.LOG_FILE_DELETED_1, getRfsName(file, vfsName)));
                  }
                  // delete the parent folder if it is empty (don't do this recursive)
                  File parent = new File(file.getParent());
                  if (parent.listFiles().length == 0) {
                      if (parent.canWrite()) {
                          parent.delete();
                          if (LOG.isInfoEnabled()) {
                              LOG.info(
                                  Messages.get().getBundle().key(Messages.LOG_FILE_DELETED_1, getRfsName(file, vfsName)));
                          }
                      }
                  }
              }
          } catch (Throwable t) {
              // ignore, nothing to do about this
              if (LOG.isWarnEnabled()) {
                  LOG.warn(
                      Messages.get().getBundle().key(Messages.LOG_FILE_DELETION_FAILED_1, getRfsName(file, vfsName)),
                      t);
              }
          }
      }
docs: Deletes the given file from the RFS, with error handling and logging.<p>
  
  If the parent folder of the file is empty after deletion, the parent folder
  is deleted also.<p>
  
  @param file the file to delete
  @param vfsName the VFS name of the file (required for logging)