private static String removeFileNameExtension(String fileName){
  if (fileName.lastIndexOf(".") == -1)   return fileName;
  return fileName.substring(0,fileName.lastIndexOf("."));
}

private static String removeFileNameExtension ( String fileName ) { if ( fileName . lastIndexOf ( "." ) == - 1 ) return fileName ; return fileName . substring ( 0 , fileName . lastIndexOf ( "." ) ) ; }
removes the extension ( whatever comes after the last ' . ' ) from the given file name .
