Here's the complete output in case that helps:

[EMAIL PROTECTED]:39:46 INFO  (DefaultFileReplicator)     - Using
"C:\Users\jcarman\AppData\Local\Temp\vfs_cache" as temporary files
store.
[EMAIL PROTECTED]:39:46 DEBUG (StandardFileSystemManager)     - Skipping
provider "org.apache.commons.vfs.provider.sftp.SftpFileProvider"
because required class "com.jcraft.jsch.JSch" is not available.
[EMAIL PROTECTED]:39:46 DEBUG (StandardFileSystemManager)     - Skipping
provider "org.apache.commons.vfs.provider.smb.SmbFileProvider" because
required class "jcifs.smb.SmbFile" is not available.
[EMAIL PROTECTED]:39:47 DEBUG (SoftRefFilesCache)     - putFile:
ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current/homologene.data
[EMAIL PROTECTED]:39:47 DEBUG (SoftRefFilesCache)     - putFile: 
ftp://ftp.ncbi.nih.gov/
[EMAIL PROTECTED]:39:47 DEBUG (SoftRefFilesCache)     - putFile:
ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current
[EMAIL PROTECTED]:39:47 DEBUG (SoftRefFilesCache)     - putFile:
ftp://ftp.ncbi.nih.gov/pub/HomoloGene
[EMAIL PROTECTED]:39:47 DEBUG (SoftRefFilesCache)     - putFile:
ftp://ftp.ncbi.nih.gov/pub
[EMAIL PROTECTED]:39:51 DEBUG (SoftRefFilesCache)     - putFile:
file:///C:/Users/jcarman/AppData/Local/Temp/download43539.txt
Exception in thread "main" org.apache.commons.vfs.FileSystemException:
Could not read from
"ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current/homologene.data";
because it is a not a file.
        at 
org.apache.commons.vfs.provider.AbstractFileObject.getInputStream(AbstractFileObject.java:1149)
        at 
org.apache.commons.vfs.provider.DefaultFileContent.getInputStream(DefaultFileContent.java:360)
        at org.apache.commons.vfs.FileUtil.writeContent(FileUtil.java:71)
        at org.apache.commons.vfs.FileUtil.copyContent(FileUtil.java:103)
        at com.myco.MyLoader.main(MyLoader.java:83)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)


On 1/28/08, James Carman <[EMAIL PROTECTED]> wrote:
> I am trying to use Commons VFS to download an FTP file from:
>
> ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current/homologene.data
>
> Here is my code:
>
> FileSystemManager fsm = VFS.getManager();
> FileObject remoteFile =
> fsm.resolveFile("ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current/homologene.data";);
> File tmp = File.createTempFile("download", ".txt");
> tmp.deleteOnExit();
> final FileObject tempFile = fsm.toFileObject(tmp);
> FileUtil.copyContent(remoteFile, tempFile);
>
> Now, sometimes this runs just fine and sometimes I get an exception:
>
> Exception in thread "main" org.apache.commons.vfs.FileSystemException:
> Could not read from
> "ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current/homologene.data";
> because it is a not a file.
>         at 
> org.apache.commons.vfs.provider.AbstractFileObject.getInputStream(AbstractFileObject.java:1149)
>         at 
> org.apache.commons.vfs.provider.DefaultFileContent.getInputStream(DefaultFileContent.java:360)
>         at org.apache.commons.vfs.FileUtil.writeContent(FileUtil.java:71)
>         at org.apache.commons.vfs.FileUtil.copyContent(FileUtil.java:103)
>
> Any ideas?  Is it just a problem with the remote FTP server being
> flaky?  I haven't had this trouble before with this code.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to