code: private static String nameOnly(final String filename) {
          final int p = filename.lastIndexOf('.');
          if (p == -1) {
              return filename;
          }
          return filename.substring(0, p);
      }
docs: Returns the name of the file without path an extension.
  
  @param filename
  Filename to extract the name from.
  
  @return Simple name.