commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derrick Rice" <>
Subject [vfs] FTP file not existing incorrectly
Date Wed, 05 Mar 2008 17:37:06 GMT
Hello,  I'm having trouble with the VFS component in an attempt to use
it to read FTP files.  Here's the basic code I am using, and it is
failing by claiming that the file does not exist, but you can plug it
into your web browser and see very clearly that it does.

The source of the trouble seems to be that the "data" folder is not
readable (cannot see listing), and that you must go directly to the
target file, rather than navigate through the file structure.  I've
tried on other FTP files that I can navigate to and they work
successfully.  How can I resolve this?  I had thought I could use some
config option to have the FtpFileSystem go directly to the file, but I
see no such option:


String path = "";
StandardFileSystemManager fsMgr = new StandardFileSystemManager();
if(!fsMgr.hasProvider("ftp")) { throw new ParserFileException("No ftp
provider"); }
FileObject reportFile = fsMgr.resolveFile(path);
if(!reportFile.exists()) { throw new ParserFileException("File does
not exist: " + path); }

This throws the ParserFileException every time.  If I don't do the
reportFile.exists() check, I get a runtime exception later when I
attempt to get the FIleContent's Stream.

Thank you,
Derrick Rice
Tufts University CS Engineering Senior

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message