public static String getRelativeName ( File file ) { if ( ! file . isAbsolute ( ) ) { String result = file . getPath ( ) . replace ( File . separatorChar , ' ' ) ; if ( isRelativeUri ( result ) ) return result ; } throw new IllegalArgumentException ( "Invalid relative path: " + file ) ; }
Converts a relative file name to a relative URI . This is different from File . toURI as this method does not canonicalize the file before creating the URI . Furthermore no schema is used .