commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tro <trowo...@gmail.com>
Subject [vfs] FTP problems
Date Mon, 31 Jul 2006 20:10:53 GMT
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


Mime
View raw message