public static String removeExtension ( String path ) throws IllegalArgumentException { Params . notNull ( path , "Path" ) ; int extensionIndex = path . lastIndexOf ( ' ' ) ; return extensionIndex != - 1 ? path . substring ( 0 , extensionIndex ) : path ; }
Remove extension from given file path and return resulting path .