James,
It might be worth sending some email to NCBI to see how they have the
HomoloGene server setup. You could determine what OS and FTP server
software they're using, as well as how they have the "current" directory
defined.
I'm not sure exactly what you're trying to get from HomoloGene, but I've
sometimes found it easier to use the eUtils web services to get what I
wanted. The downloads are shorter, and you have better control over what
you're fetching.
Hope this helps,
Mark
On Jan 29, 2008 7:53 AM, James Carman <[EMAIL PROTECTED]> wrote:
> How about if "current" in the URL is a symbolic link? Should that
> mess it up (sometimes)? I would think that it would either mess it up
> all the time or none of the time.
>
> On 1/29/08, James Carman <[EMAIL PROTECTED]> wrote:
> > Could there be some sort of race condition going on here? I see that
> > there is a thread started by the SoftRefFilesCache (which is what it
> > seems to be using here).
> >
> > On 1/29/08, James Carman <[EMAIL PROTECTED]> wrote:
> > > I compiled it from src into my local repository. I'll see if I can
> > > figure it out via debugging.
> > >
> > > On 1/29/08, sebb <[EMAIL PROTECTED]> wrote:
> > > > Might be an idea to have a look at the code to see what conditions
> > > > cause the Exception to be thrown ... which version of VFS are you
> > > > using?
> > > >
> > > > I had a quick look at 1.0, and there is no Exception at
> > > > AbstractFileObject.java:1149 as far as I can tell.
> > > >
> > > > On 29/01/2008, James Carman <[EMAIL PROTECTED]> wrote:
> > > > > I'm not very well versed with Wireshark and the like. Any
> pointers on
> > > > > what I should look for?
> > > > >
> > > > > On 1/29/08, Mario Ivankovits <[EMAIL PROTECTED]> wrote:
> > > > > > Hi!
> > > > > >
> > > > > > I think your only chance is to use tcpdump and/or wireshark to
> debug the
> > > > > > network flow to see the real answers of the ftp server.
> > > > > > Or debug into the VFS code ... somewhere in doAttach in
> FtpFileObject
> > > > > > and see whats going wrong in there.
> > > > > >
> > > > > > Sorry!
> > > > > >
> > > > > > Ciao,
> > > > > > Mario
> > > > > >
> > > > > > > Well, I ran it once and it said "The file type is file" and it
> > > > > > > succeeded, but then I ran it again and it says "The file type
> is
> > > > > > > imaginary" and it failed. Here's the code:
> > > > > > >
> > > > > > > final FileSystemManager fsm = VFS.getManager();
> > > > > > > final FileObject remoteFile =
> > > > > > > fsm.resolveFile("
> ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current/homologene.data");
> > > > > > > System.out.println("The file type is " +
> > > > > > > remoteFile.getType().getName() + ".");
> > > > > > > final File tmp = File.createTempFile("download",
> ".txt");
> > > > > > > tmp.deleteOnExit();
> > > > > > > final FileObject tempFile = fsm.toFileObject(tmp);
> > > > > > > FileUtil.copyContent(remoteFile, tempFile);
> > > > > > >
> > > > > > > Here's the complete output:
> > > > > > >
> > > > > > > [EMAIL PROTECTED]:18:11 INFO (DefaultFileReplicator) - Using
> > > > > > > "C:\Users\jcarman\AppData\Local\Temp\vfs_cache" as temporary
> files
> > > > > > > store.
> > > > > > > [EMAIL PROTECTED]:18:12 DEBUG (StandardFileSystemManager) -
> Skipping
> > > > > > > provider "
> org.apache.commons.vfs.provider.sftp.SftpFileProvider"
> > > > > > > because required class "com.jcraft.jsch.JSch" is not
> available.
> > > > > > > [EMAIL PROTECTED]:18:12 DEBUG (StandardFileSystemManager) -
> Skipping
> > > > > > > provider "org.apache.commons.vfs.provider.smb.SmbFileProvider"
> because
> > > > > > > required class "jcifs.smb.SmbFile" is not available.
> > > > > > > [EMAIL PROTECTED]:18:12 DEBUG (SoftRefFilesCache) - putFile:
> > > > > > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current/homologene.data
> > > > > > > [EMAIL PROTECTED]:18:12 DEBUG (SoftRefFilesCache) - putFile:
> ftp://ftp.ncbi.nih.gov/
> > > > > > > [EMAIL PROTECTED]:18:12 DEBUG (SoftRefFilesCache) - putFile:
> > > > > > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current
> > > > > > > [EMAIL PROTECTED]:18:12 DEBUG (SoftRefFilesCache) - putFile:
> > > > > > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene
> > > > > > > [EMAIL PROTECTED]:18:12 DEBUG (SoftRefFilesCache) - putFile:
> > > > > > > ftp://ftp.ncbi.nih.gov/pub
> > > > > > > The file type is imaginary.
> > > > > > > [EMAIL PROTECTED]:18:13 DEBUG (SoftRefFilesCache) - putFile:
> > > > > > > file:///C:/Users/jcarman/AppData/Local/Temp/download14482.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)
> > > > > > >
> > > > > > > I left out the project-specific parts of the stack trace
> because it's
> > > > > > > not relevant, but there were no nested exceptions.
> > > > > > >
> > > > > > > On 1/29/08, Mario Ivankovits <[EMAIL PROTECTED]> wrote:
> > > > > > >
> > > > > > >> Hi!
> > > > > > >>
> > > > > > >>> Did you get my second email? That's the entire output I got
> when I ran it.
> > > > > > >>>
> > > > > > >>>
> > > > > > >> Uh, oh, ok!
> > > > > > >>
> > > > > > >> So then, it seems that VFS thinks the file is either a
> directory or non
> > > > > > >> existent.
> > > > > > >>
> > > > > > >> Could you please:
> > > > > > >>
> > > > > > >> *) check the filetype of the FileObject see if its virtual or
> whatever
> > > > > > >> *) try to connect to the ftp server using a commandline tool
> to see if
> > > > > > >> the ftp output is in a style which makes it impossible for
> commons-net
> > > > > > >> to parse the output, e.g. due to localized date format.
> > > > > > >>
> > > > > > >> Ciao,
> > > > > > >> Mario
> > > > > > >>
> > > > > > >>
> > > > > > >>
> ---------------------------------------------------------------------
> > > > > > >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > > >> For additional commands, e-mail: [EMAIL PROTECTED]
> > > > > > >>
> > > > > > >>
> > > > > > >>
> > > > > > >
> > > > > > >
> ---------------------------------------------------------------------
> > > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > mit freundlichen Grüßen
> > > > > >
> > > > > > Mario Ivankovits
> > > > > > Software Engineering
> > > > > >
> > > > > > OPS EDV VertriebsgesmbH
> > > > > > A-1120 Wien, Michael-Bernhard-Gasse 10
> > > > > >
> > > > > > Firmenbuch Nr.: FN51233v, Handelsgericht Wien
> > > > > > Tel.: +43-1-8938810; Fax: +43-1-8938810/3700
> > > > > > http://www.ops.co.at
> > > > > >
> > > > > > E-Mail: [EMAIL PROTECTED]
> > > > > > Skype: mario_ivankovits
> > > > > >
> > > > > >
> > > > > >
> ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > > >
> > > > > >
> > > > >
> > > > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > >
> > > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>