I think you that your code is converting the target folder to the source file.
It is a bit strange and dangerous as well the way VFS works, I once deleted a
folder with lots of semi-important files like that...
You should first resolve the full path of the target file:
FileObject targetFile =
fsManager.resolveFile("ftp://myuser:[email protected]/home/myuser/test-xls/test.txt");
Or:
FileObject targetFile =
fsManager.resolveFile("ftp://myuser:[email protected]/home/myuser/test-xls").resolveFile(sourceFile.getName().getBaseName());
(Or something similar, I didn't check the exact syntax...)
Cheers,
Frank
> From: [email protected]
> To: [email protected]
> Subject: [fs] Problem with FTP:
> Date: Thu, 12 Aug 2010 12:16:57 -0400
>
> I have the following URL:
>
> ftp://myuser:[email protected]/home/myuser/test-xls
>
> and am trying to copy a file into that directory.
>
> Here is the code I'm using:
>
> FileObject sourceFile =
> fsManager.resolveFile("/tmp/test.txt");
> FileObject targetFile =
> fsManager.resolveFile("ftp://myuser:[email protected]/home/myuser/test-x
> ls");
> targetFile.copyFrom(sourceFile, new
> AllFileSelector());
>
> I don't get an error, and I know it can connect because I get an exception
> if I break the password or site name. Any ideas why the put is not working?
>
> Thanks,
> Mike.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>