public static File removeExtension(File file){
  final String fileFilename=file.getName();
  final int beginIndex=fileFilename.lastIndexOf('.');
  if (beginIndex > 0) {
    return new File(file.getParentFile(),fileFilename.substring(0,beginIndex));
  }
  return file;
}

public static File removeExtension ( File file ) { final String fileFilename = file . getName ( ) ; final int beginIndex = fileFilename . lastIndexOf ( '.' ) ; if ( beginIndex > 0 ) { return new File ( file . getParentFile ( ) , fileFilename . substring ( 0 , beginIndex ) ) ; } return file ; }
remove the last extension from a file ' s filename
