commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel French <dfrench...@yahoo.com>
Subject VFS - FTP File Does Not Exist Troubleshooting
Date Fri, 04 Mar 2011 05:31:42 GMT
Hi 

I am using Apache Commons VFS and I am able to download a file from a 
test ftp site without a problem.   Below is a code snippet.

FileObjectsourceFile = 
fsManager.resolveFile("ftp://test:test@ftp.secureftp-test.com/subdir1/a/HelloWorld123.txt")



Under this scenario, sourceFile.exists() method call returns true and the code 
to copy a 

file works as expected.

However, when I try to download files from my company's ftp site with the same 
java class that I have developed, I am unable to download the file.   I receive 
an error message that the file doesn't exist when it clearly exists.

The error I receive is.

org.apache.commons.vfs.FileSystemException: Could not copy 
"ftp://: company's ftp site>/great_wall/test.txt" because 
it does not exist.
        at 
org.apache.commons.vfs.provider.AbstractFileObject.copyFrom(AbstractFileObject.java:858)



I have replaced the actual user name/password/company ftp site for obvious 
reasons.   However, from Internet Explorer, I am able to paste the url that I am 

using to download the file without a problem from the same server so I know the 
file can be viewed/retrieved.  

In addition, ftping to my company's ftp site works fine from the Windows command 

prompt on the same computer.

Is there anything I should be asking the networking person at my company 
responsible for the ftp server I am using?     I believe the ftp site is 
somewhat new.  

I searched to see if others have experienced this issue and I did try adding the 

following but it hasn't helped.

 FileSystemOptionsfso = new FileSystemOptions();
 FtpFileSystemConfigBuilder.getInstance().setPassiveMode(fso, false);

Are there any other suggested updates to my java code to get past this issue?  

Thanks for any suggestions.   --Dan


      

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


Mime
View raw message