question: public static File removeExtension ( File file ) { String absolutePath = file . getAbsolutePath ( ) ; if ( absolutePath . contains ( "." ) ) { return new File ( absolutePath . substring ( 0 , absolutePath . lastIndexOf ( '.' ) ) ) ; } else { return file ; } }
target:  Remove the last extension of file. If no extension found then return the input file E.g. a.out.log --> a.out a.diff --> a