private static String stripExtension(String filename){
  return filename.replaceFirst("\\.[^.]+$","");
}

private static String stripExtension ( String filename ) { return filename . replaceFirst ( "\\.[^.]+$" , "" ) ; }
strip off the filename extension , if it ' s present .
