You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Tro <tr...@gmail.com> on 2006/07/31 22:10:53 UTC

[vfs] FTP problems

Hi.

I can't get vfs to write a file to my FTP server.

The error:

"org.apache.commons.vfs.FileSystemException: Could not determine if 
file "ftp://username:password@server.com/xxxsomething.zip" is writeable."

The code:

String ftpAddress = "ftp://username:password@server.com/";
try {
    tmpRemFile = VFS.getManager().resolveFile(
        ftpAddress + "xxx" + zipFile.getName());
    if (!tmpRemFile.exists())
        tmpRemFile.createFile();
	.........
} catch (Exception e) {
    gui.showListWarning(e.getLocalizedMessage() + "\n" + e.getCause());
        e.printStackTrace();
    return false;
}

tmpRemFile is a FileObject, but it's imaginary (doesn't exist on the server). 
The exception is thrown after executing "tmpRemFile.createFile();"

I've noticed that if the file is already on the server, the exception isn't 
thrown. Doing anything else with the file (rename, delete) still raises the 
exception.

I've tried this with two different FTP servers and several recent nightlies. 
I've got all the dependencies necessary, I think (logging, net, oro). I can, 
of course, log in and write a file to the server with any standalone client.

What am I doing wrong?

Thanks,
Tro

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