commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "B. K. Oxley (binkley)" <bink...@alumni.rice.edu>
Subject Re: [vfs] parsing uri
Date Mon, 07 Mar 2005 20:52:26 GMT
Rami Ojares wrote:
> public FileObject findLocalFile(final File file)
>    throws FileSystemException
> {
>    // TODO - tidy this up, should build file object straight from the file
>        return findFile(null, "file:" + 
> ENCODE_URI_SOMEHOW(file.getAbsolutePath()), null);
> }

I would do even less work than that (being as lazy as I am):

public FileObject findLocalFile(final File file)
         throws FileSystemException {
     return findFile(null, file.toURI().toString(), null);
}

java.io.File is handy that way.  :-)


Cheers,
--binkley

---------------------------------------------------------------------
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