public static String normalizePath ( String _path , boolean _appendFinalSeparator ) { if ( _path == null ) { return _path ; } String path = _path . replace ( "\\" , FILE_SEPARATOR ) . replace ( "/" , FILE_SEPARATOR ) ; if ( _appendFinalSeparator && ! path . endsWith ( FILE_SEPARATOR ) ) { path += FILE_SEPARATOR ; } return path ; }
Normalize a file system path expression for the current OS . Replaces path separators by this OS s path separator . Appends a final path separator if parameter is set and if not yet present .