private String stripExtension(String file,String extension){
  if (file.endsWith(extension)) {
    int index=file.lastIndexOf('.');
    String s=file.substring(0,index);
    return s;
  }
  return file;
}

private String stripExtension ( String file , String extension ) { if ( file . endsWith ( extension ) ) { int index = file . lastIndexOf ( '.' ) ; String s = file . substring ( 0 , index ) ; return s ; } return file ; }
strips file extension from a string that represents a file
