code: public static String basename(File file)
    {
      if(file == null) {
        return null;
      }
      String fileName = file.getName();
      int i = fileName.lastIndexOf('.');
      return i != -1 ? fileName.substring(0, i) : fileName;
    }
docs: Return file name without extension. Returns null if given <code>file</code> parameter is null.
  
  @param file file to return base name for.
  @return file name, without extension, or null.