core/src/main/java/org/apache/commons/vfs2/provider/url/UrlFileProvider.java
/**
     * Locates a file object, by absolute URI.
     * @param baseFile The base FileObject.
     * @param uri The uri of the file to locate.
     * @param fileSystemOptions The FileSystemOptions
     * @return The FileObject
     * @throws FileSystemException if an error occurs.
     */
Locates a file object, by absolute URI.
@param baseFile The base FileObject.
@param uri The uri of the file to locate.
Locates a file object by absolute URI . @param baseFile The base FileObject . @param uri The uri of the file to locate .
public synchronized FileObject findFile(final FileObject baseFile,
                                            final String uri,
                                            final FileSystemOptions fileSystemOptions)
        throws FileSystemException
    {
        try
        {
            final URL url = new URL(uri);
            URL rootUrl = new URL(url, "/");
            final String key = this.getClass().getName() + rootUrl.toString();
            FileSystem fs = findFileSystem(key, fileSystemOptions);
            if (fs == null)
            {
                String extForm = rootUrl.toExternalForm();
                final FileName rootName =
                    getContext().parseURI(extForm);
                fs = new UrlFileSystem(rootName, fileSystemOptions);
                addFileSystem(key, fs);
            }
            return fs.resolveFile(url.getPath());
        }
        catch (final MalformedURLException e)
        {
            throw new FileSystemException("vfs.provider.url/badly-formed-uri.error", uri, e);
        }
    }
public synchronized FileObject findFile ( final FileObject baseFile , final String uri , final FileSystemOptions fileSystemOptions ) throws FileSystemException { try { final URL url = new URL ( uri ) ; URL rootUrl = new URL ( url , "/" ) ; final String key = this . getClass ( ) . getName ( ) + rootUrl . toString ( ) ; FileSystem fs = findFileSystem ( key , fileSystemOptions ) ; if ( fs == null ) { String extForm = rootUrl . toExternalForm ( ) ; final FileName rootName = getContext ( ) . parseURI ( extForm ) ; fs = new UrlFileSystem ( rootName , fileSystemOptions ) ; addFileSystem ( key , fs ) ; } return fs . resolveFile ( url . getPath ( ) ) ; } catch ( final MalformedURLException e ) { throw new FileSystemException ( "vfs.provider.url/badly-formed-uri.error" , uri , e ) ; } }
Locates a file object, by absolute URI.
Locates a file object by absolute URI .
// final FileName rootName = //    new BasicFileName(rootUrl, FileName.ROOT_PATH);