code: public static void delete(File file) throws IOException
    {
      Params.notNull(file, "File");
      if(file.exists() && !file.delete()) {
        throw new IOException(Strings.format("Fail to delete file |%s|.", file));
      }
    }
docs: Delete file if exists throwing exception if delete fails. Note that this method does nothing if file does not
  exist; anyway, null parameter sanity check is still performed.
  
  @param file file path.
  @throws IOException if delete operation fails.
  @throws IllegalArgumentException if <code>file</code> parameter is null.