commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rami Ojares <rami.oja...@elisa.fi>
Subject Re: [vfs] parsing uri
Date Mon, 07 Mar 2005 21:14:31 GMT
Here is my proposal using idea from binkley


    /**
     * Finds a local file, from its local name.
     */
    public FileObject findLocalFile(final String name)
        throws FileSystemException
    {
        // TODO - tidy this up, no need to turn the name into an 
absolute URI,
        // and then straight back again
        return findFile(null, (new File(name)).toURI().toString(), null);
    }

    /**
     * Finds a local file.
     */
    public FileObject findLocalFile(final File file)
        throws FileSystemException
    {
        // TODO - tidy this up, should build file object straight from 
the file
        return findFile(null, file.getAbsoluteFile().toURI().toString(), 
null);
    }

I tried it and it worked.

- rami

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message