protected String cutExtension(String name){
  int idx=name.lastIndexOf('.');
  if (idx >= 0) {
    return name.substring(0,idx);
  }
 else {
    return name;
  }
}

protected String cutExtension ( String name ) { int idx = name . lastIndexOf ( '.' ) ; if ( idx >= 0 ) { return name . substring ( 0 , idx ) ; } else { return name ; } }
returns a filename without its extension .
