code: public static String getName(String fileName){
          int dot = fileName.lastIndexOf('.');
          return dot==-1 ? fileName : fileName.substring(0, dot);
      }
docs: Returns name of the file without extension