code: public boolean deleteFile(String filePath) throws IOException {
          boolean result = false;
          // synchronized on an interned string makes has all the
          // makings for exclusive write access as far as this
          // process is concerned.
          String path = (String) Utils.intern(filePath);
          synchronized (path) {
              File file = null;
              try {
                  file = new File(path);
                  if (file.exists()) {
                      if (file.canWrite()) {
                          result = file.delete();
                      } else {
                          String msg = 
                              "Can not delete write locked file (" + filePath + ")";
                          
                          mLog.warn(msg);
                          throw new IOException(msg);
                      }
                  } else {
                      String msg =
                          "Cannot delete non-existant file (" + filePath + ")";
                      
                      mLog.warn(msg);
                      throw new IOException(msg);
                  }
              } catch (IOException e) {
                  mLog.error("Error deleting: " + filePath);
                  mLog.error(e);
                  throw e;
              }
          }
          return result;
      }
docs: Delete the file at the given path.
  
  @param filePath The path of the file to delete
  
  @return <code>true</code> if the file was deleted,
  <code>false</code> otherwise
  
  @throws IOException if the file does not exist, cannot be written,
  or if an error occurs during deletion