You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by James Carman <ja...@carmanconsulting.com> on 2008/01/29 03:29:37 UTC

[vfs] Inconsistent Behavior...

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: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [vfs] Inconsistent Behavior...

Posted by Torsten Curdt <tc...@apache.org>.
Frankly speaking this sounds awfully like something I have  
encountered (and fixed) before.
...but that has been years ago and my brain just does not want to  
spit it out. Bah! Sorry :(

cheers
--
Torsten

On 29.01.2008, at 15:45, Mario Ivankovits 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:
>>
>> 01-29@09:18:11 INFO  (DefaultFileReplicator)     - Using
>> "C:\Users\jcarman\AppData\Local\Temp\vfs_cache" as temporary files
>> store.
>> 01-29@09:18:12 DEBUG (StandardFileSystemManager)     - Skipping
>> provider "org.apache.commons.vfs.provider.sftp.SftpFileProvider"
>> because required class "com.jcraft.jsch.JSch" is not available.
>> 01-29@09:18:12 DEBUG (StandardFileSystemManager)     - Skipping
>> provider "org.apache.commons.vfs.provider.smb.SmbFileProvider"  
>> because
>> required class "jcifs.smb.SmbFile" is not available.
>> 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
>> ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current/homologene.data
>> 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile: ftp:// 
>> ftp.ncbi.nih.gov/
>> 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
>> ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current
>> 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
>> ftp://ftp.ncbi.nih.gov/pub/HomoloGene
>> 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
>> ftp://ftp.ncbi.nih.gov/pub
>> The file type is imaginary.
>> 01-29@09: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 <ma...@ops.co.at> 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: user-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: user-help@commons.apache.org
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>>
>
>
> -- 
> 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: mario@ops.co.at
> Skype: mario_ivankovits
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>


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


Re: [vfs] Inconsistent Behavior...

Posted by Mark Fortner <ph...@gmail.com>.
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 <ja...@carmanconsulting.com> 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 <ja...@carmanconsulting.com> 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 <ja...@carmanconsulting.com> 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 <se...@gmail.com> 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 <ja...@carmanconsulting.com> 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 <ma...@ops.co.at> 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:
> > > > > > >
> > > > > > > 01-29@09:18:11 INFO  (DefaultFileReplicator)     - Using
> > > > > > > "C:\Users\jcarman\AppData\Local\Temp\vfs_cache" as temporary
> files
> > > > > > > store.
> > > > > > > 01-29@09:18:12 DEBUG (StandardFileSystemManager)     -
> Skipping
> > > > > > > provider "
> org.apache.commons.vfs.provider.sftp.SftpFileProvider"
> > > > > > > because required class "com.jcraft.jsch.JSch" is not
> available.
> > > > > > > 01-29@09:18:12 DEBUG (StandardFileSystemManager)     -
> Skipping
> > > > > > > provider "org.apache.commons.vfs.provider.smb.SmbFileProvider"
> because
> > > > > > > required class "jcifs.smb.SmbFile" is not available.
> > > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > > > > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current/homologene.data
> > > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> ftp://ftp.ncbi.nih.gov/
> > > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > > > > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current
> > > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > > > > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene
> > > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > > > > > ftp://ftp.ncbi.nih.gov/pub
> > > > > > > The file type is imaginary.
> > > > > > > 01-29@09: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 <ma...@ops.co.at> 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: user-unsubscribe@commons.apache.org
> > > > > > >> For additional commands, e-mail: user-help@commons.apache.org
> > > > > > >>
> > > > > > >>
> > > > > > >>
> > > > > > >
> > > > > > >
> ---------------------------------------------------------------------
> > > > > > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > > > > > For additional commands, e-mail: user-help@commons.apache.org
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > 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: mario@ops.co.at
> > > > > > Skype: mario_ivankovits
> > > > > >
> > > > > >
> > > > > >
> ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > > > > For additional commands, e-mail: user-help@commons.apache.org
> > > > > >
> > > > > >
> > > > >
> > > > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > > > For additional commands, e-mail: user-help@commons.apache.org
> > > > >
> > > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > > For additional commands, e-mail: user-help@commons.apache.org
> > > >
> > > >
> > >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

Re: [vfs] Inconsistent Behavior...

Posted by James Carman <ja...@carmanconsulting.com>.
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 <ja...@carmanconsulting.com> 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 <ja...@carmanconsulting.com> 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 <se...@gmail.com> 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 <ja...@carmanconsulting.com> 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 <ma...@ops.co.at> 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:
> > > > > >
> > > > > > 01-29@09:18:11 INFO  (DefaultFileReplicator)     - Using
> > > > > > "C:\Users\jcarman\AppData\Local\Temp\vfs_cache" as temporary files
> > > > > > store.
> > > > > > 01-29@09:18:12 DEBUG (StandardFileSystemManager)     - Skipping
> > > > > > provider "org.apache.commons.vfs.provider.sftp.SftpFileProvider"
> > > > > > because required class "com.jcraft.jsch.JSch" is not available.
> > > > > > 01-29@09:18:12 DEBUG (StandardFileSystemManager)     - Skipping
> > > > > > provider "org.apache.commons.vfs.provider.smb.SmbFileProvider" because
> > > > > > required class "jcifs.smb.SmbFile" is not available.
> > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > > > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current/homologene.data
> > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile: ftp://ftp.ncbi.nih.gov/
> > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > > > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current
> > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > > > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene
> > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > > > > ftp://ftp.ncbi.nih.gov/pub
> > > > > > The file type is imaginary.
> > > > > > 01-29@09: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 <ma...@ops.co.at> 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: user-unsubscribe@commons.apache.org
> > > > > >> For additional commands, e-mail: user-help@commons.apache.org
> > > > > >>
> > > > > >>
> > > > > >>
> > > > > >
> > > > > > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > > > > For additional commands, e-mail: user-help@commons.apache.org
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > 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: mario@ops.co.at
> > > > > Skype: mario_ivankovits
> > > > >
> > > > >
> > > > > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > > > For additional commands, e-mail: user-help@commons.apache.org
> > > > >
> > > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > > For additional commands, e-mail: user-help@commons.apache.org
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > For additional commands, e-mail: user-help@commons.apache.org
> > >
> > >
> >
>

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


Re: [vfs] Inconsistent Behavior...

Posted by James Carman <ja...@carmanconsulting.com>.
I'll see what I can do.  By the way, do you want me to get the m2
build working?  I can do it, but I'll have to move some stuff around a
bit.  Is that okay?

On 1/31/08, Mario Ivankovits <ma...@ops.co.at> wrote:
> Hi James!
> > I have fix for this I believe.
> Good to hear :-) - and - good catch!
> > final String path = fileInfo != null && fileInfo.isSymbolicLink() ?
> > getParent().getName().getPath() + "/" + fileInfo.getLink() : relPath;
> >             final FTPFile[] tmpChildren = client.listFiles(path);
> >
> Somewhere in VFS there is already some limited support for links, cant
> remember it yet, have to look into the source.
> The way you construct the new path does not honor the fact that the link
> might be an absolute path. I think VFS's link support can deal with that.
>
> If you have some additional time it would be great if you could figure
> that out please ....
>
> Thanks!
>
> Ciao,
> Mario
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

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


Re: [vfs] Inconsistent Behavior...

Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi James!
> I have fix for this I believe.
Good to hear :-) - and - good catch!
> final String path = fileInfo != null && fileInfo.isSymbolicLink() ?
> getParent().getName().getPath() + "/" + fileInfo.getLink() : relPath;
>             final FTPFile[] tmpChildren = client.listFiles(path);
>   
Somewhere in VFS there is already some limited support for links, cant 
remember it yet, have to look into the source.
The way you construct the new path does not honor the fact that the link 
might be an absolute path. I think VFS's link support can deal with that.

If you have some additional time it would be great if you could figure 
that out please ....

Thanks!

Ciao,
Mario


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


Re: [vfs] Inconsistent Behavior...

Posted by James Carman <ja...@carmanconsulting.com>.
I have fix for this I believe.  Unfortunately, I cannot run the test
suite on my computer, because I don't have everything set up correctly
(the FileSystemManagerFactoryTestCase fails for me).  I haven't worked
on VFS before, so I don't want to step on anyone's toes by just
committing things.  I'll just open up a JIRA issue and submit a patch
to it.  Basically, I just changed the doGetChildren() like this:

final String path = fileInfo != null && fileInfo.isSymbolicLink() ?
getParent().getName().getPath() + "/" + fileInfo.getLink() : relPath;
            final FTPFile[] tmpChildren = client.listFiles(path);

If it's a symbolic link, I just construct a path to the linked file
and list its contents.  Sound good?  It works for me in my specific
case, but I know that's not exactly the requirements for VFS (working
for my specific case). :)


On 1/31/08, James Carman <ja...@carmanconsulting.com> wrote:
> Okay, I think I might be onto something here.  I've added some code in
> to help me out a bit.  Here's what I added to FtpFileObject (in the
> getChildFile method):
>
> final StringBuffer msg = new StringBuffer();
> msg.append("Children of " + getName() + " are: \n" );
> for( java.util.Iterator i = children.keySet().iterator(); i.hasNext(); )
> {
>    final Object key = i.next();
>    msg.append( key + " -> " + children.get(key) + "\n" );
> }
> log.debug(msg);
>
> This is right after the call to doGetChildren().  Anyway, here's my output:
>
> 01-31@09:20:21 DEBUG (FtpFileObject)     - Children of
> ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current are:
> pub/HomoloGene/current -> lr--r--r--   1 ftp      anonymous        7
> Nov 21 21:42 pub/HomoloGene/current -> build58
>
> Basically, "current" is a symbolic link.  And, on that particular FTP
> server, apparently when you do a listing of that symbolic link, it
> just shows you that it's a link and not the contents of the linked
> directory.  So, the child map doesn't contain an entry for my file by
> name.  So, it comes back with a null fileInfo and thus it's an
> imaginary file.
>
>
> On 1/29/08, James Carman <ja...@carmanconsulting.com> wrote:
> > I tried changing the files cache to Default and LRU and it didn't
> > help.  So, it doesn't look like a race condition.  I'll keep digging.
> >
> > On 1/29/08, James Carman <ja...@carmanconsulting.com> 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 <ja...@carmanconsulting.com> 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 <se...@gmail.com> 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 <ja...@carmanconsulting.com> 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 <ma...@ops.co.at> 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:
> > > > > > > >
> > > > > > > > 01-29@09:18:11 INFO  (DefaultFileReplicator)     - Using
> > > > > > > > "C:\Users\jcarman\AppData\Local\Temp\vfs_cache" as temporary files
> > > > > > > > store.
> > > > > > > > 01-29@09:18:12 DEBUG (StandardFileSystemManager)     - Skipping
> > > > > > > > provider "org.apache.commons.vfs.provider.sftp.SftpFileProvider"
> > > > > > > > because required class "com.jcraft.jsch.JSch" is not available.
> > > > > > > > 01-29@09:18:12 DEBUG (StandardFileSystemManager)     - Skipping
> > > > > > > > provider "org.apache.commons.vfs.provider.smb.SmbFileProvider" because
> > > > > > > > required class "jcifs.smb.SmbFile" is not available.
> > > > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > > > > > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current/homologene.data
> > > > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile: ftp://ftp.ncbi.nih.gov/
> > > > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > > > > > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current
> > > > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > > > > > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene
> > > > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > > > > > > ftp://ftp.ncbi.nih.gov/pub
> > > > > > > > The file type is imaginary.
> > > > > > > > 01-29@09: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 <ma...@ops.co.at> 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: user-unsubscribe@commons.apache.org
> > > > > > > >> For additional commands, e-mail: user-help@commons.apache.org
> > > > > > > >>
> > > > > > > >>
> > > > > > > >>
> > > > > > > >
> > > > > > > > ---------------------------------------------------------------------
> > > > > > > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > > > > > > For additional commands, e-mail: user-help@commons.apache.org
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > 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: mario@ops.co.at
> > > > > > > Skype: mario_ivankovits
> > > > > > >
> > > > > > >
> > > > > > > ---------------------------------------------------------------------
> > > > > > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > > > > > For additional commands, e-mail: user-help@commons.apache.org
> > > > > > >
> > > > > > >
> > > > > >
> > > > > > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > > > > For additional commands, e-mail: user-help@commons.apache.org
> > > > > >
> > > > > >
> > > > >
> > > > > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > > > For additional commands, e-mail: user-help@commons.apache.org
> > > > >
> > > > >
> > > >
> > >
> >
>

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


Re: [vfs] Inconsistent Behavior...

Posted by James Carman <ja...@carmanconsulting.com>.
Okay, I think I might be onto something here.  I've added some code in
to help me out a bit.  Here's what I added to FtpFileObject (in the
getChildFile method):

final StringBuffer msg = new StringBuffer();
msg.append("Children of " + getName() + " are: \n" );
for( java.util.Iterator i = children.keySet().iterator(); i.hasNext(); )
{
   final Object key = i.next();
   msg.append( key + " -> " + children.get(key) + "\n" );
}
log.debug(msg);

This is right after the call to doGetChildren().  Anyway, here's my output:

01-31@09:20:21 DEBUG (FtpFileObject)     - Children of
ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current are:
pub/HomoloGene/current -> lr--r--r--   1 ftp      anonymous        7
Nov 21 21:42 pub/HomoloGene/current -> build58

Basically, "current" is a symbolic link.  And, on that particular FTP
server, apparently when you do a listing of that symbolic link, it
just shows you that it's a link and not the contents of the linked
directory.  So, the child map doesn't contain an entry for my file by
name.  So, it comes back with a null fileInfo and thus it's an
imaginary file.


On 1/29/08, James Carman <ja...@carmanconsulting.com> wrote:
> I tried changing the files cache to Default and LRU and it didn't
> help.  So, it doesn't look like a race condition.  I'll keep digging.
>
> On 1/29/08, James Carman <ja...@carmanconsulting.com> 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 <ja...@carmanconsulting.com> 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 <se...@gmail.com> 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 <ja...@carmanconsulting.com> 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 <ma...@ops.co.at> 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:
> > > > > > >
> > > > > > > 01-29@09:18:11 INFO  (DefaultFileReplicator)     - Using
> > > > > > > "C:\Users\jcarman\AppData\Local\Temp\vfs_cache" as temporary files
> > > > > > > store.
> > > > > > > 01-29@09:18:12 DEBUG (StandardFileSystemManager)     - Skipping
> > > > > > > provider "org.apache.commons.vfs.provider.sftp.SftpFileProvider"
> > > > > > > because required class "com.jcraft.jsch.JSch" is not available.
> > > > > > > 01-29@09:18:12 DEBUG (StandardFileSystemManager)     - Skipping
> > > > > > > provider "org.apache.commons.vfs.provider.smb.SmbFileProvider" because
> > > > > > > required class "jcifs.smb.SmbFile" is not available.
> > > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > > > > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current/homologene.data
> > > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile: ftp://ftp.ncbi.nih.gov/
> > > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > > > > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current
> > > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > > > > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene
> > > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > > > > > ftp://ftp.ncbi.nih.gov/pub
> > > > > > > The file type is imaginary.
> > > > > > > 01-29@09: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 <ma...@ops.co.at> 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: user-unsubscribe@commons.apache.org
> > > > > > >> For additional commands, e-mail: user-help@commons.apache.org
> > > > > > >>
> > > > > > >>
> > > > > > >>
> > > > > > >
> > > > > > > ---------------------------------------------------------------------
> > > > > > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > > > > > For additional commands, e-mail: user-help@commons.apache.org
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > 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: mario@ops.co.at
> > > > > > Skype: mario_ivankovits
> > > > > >
> > > > > >
> > > > > > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > > > > For additional commands, e-mail: user-help@commons.apache.org
> > > > > >
> > > > > >
> > > > >
> > > > > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > > > For additional commands, e-mail: user-help@commons.apache.org
> > > > >
> > > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > > For additional commands, e-mail: user-help@commons.apache.org
> > > >
> > > >
> > >
> >
>

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


Re: [vfs] Inconsistent Behavior...

Posted by James Carman <ja...@carmanconsulting.com>.
I tried changing the files cache to Default and LRU and it didn't
help.  So, it doesn't look like a race condition.  I'll keep digging.

On 1/29/08, James Carman <ja...@carmanconsulting.com> 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 <ja...@carmanconsulting.com> 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 <se...@gmail.com> 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 <ja...@carmanconsulting.com> 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 <ma...@ops.co.at> 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:
> > > > > >
> > > > > > 01-29@09:18:11 INFO  (DefaultFileReplicator)     - Using
> > > > > > "C:\Users\jcarman\AppData\Local\Temp\vfs_cache" as temporary files
> > > > > > store.
> > > > > > 01-29@09:18:12 DEBUG (StandardFileSystemManager)     - Skipping
> > > > > > provider "org.apache.commons.vfs.provider.sftp.SftpFileProvider"
> > > > > > because required class "com.jcraft.jsch.JSch" is not available.
> > > > > > 01-29@09:18:12 DEBUG (StandardFileSystemManager)     - Skipping
> > > > > > provider "org.apache.commons.vfs.provider.smb.SmbFileProvider" because
> > > > > > required class "jcifs.smb.SmbFile" is not available.
> > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > > > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current/homologene.data
> > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile: ftp://ftp.ncbi.nih.gov/
> > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > > > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current
> > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > > > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene
> > > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > > > > ftp://ftp.ncbi.nih.gov/pub
> > > > > > The file type is imaginary.
> > > > > > 01-29@09: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 <ma...@ops.co.at> 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: user-unsubscribe@commons.apache.org
> > > > > >> For additional commands, e-mail: user-help@commons.apache.org
> > > > > >>
> > > > > >>
> > > > > >>
> > > > > >
> > > > > > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > > > > For additional commands, e-mail: user-help@commons.apache.org
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > 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: mario@ops.co.at
> > > > > Skype: mario_ivankovits
> > > > >
> > > > >
> > > > > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > > > For additional commands, e-mail: user-help@commons.apache.org
> > > > >
> > > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > > For additional commands, e-mail: user-help@commons.apache.org
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > For additional commands, e-mail: user-help@commons.apache.org
> > >
> > >
> >
>

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


Re: [vfs] Inconsistent Behavior...

Posted by James Carman <ja...@carmanconsulting.com>.
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 <ja...@carmanconsulting.com> 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 <se...@gmail.com> 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 <ja...@carmanconsulting.com> 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 <ma...@ops.co.at> 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:
> > > > >
> > > > > 01-29@09:18:11 INFO  (DefaultFileReplicator)     - Using
> > > > > "C:\Users\jcarman\AppData\Local\Temp\vfs_cache" as temporary files
> > > > > store.
> > > > > 01-29@09:18:12 DEBUG (StandardFileSystemManager)     - Skipping
> > > > > provider "org.apache.commons.vfs.provider.sftp.SftpFileProvider"
> > > > > because required class "com.jcraft.jsch.JSch" is not available.
> > > > > 01-29@09:18:12 DEBUG (StandardFileSystemManager)     - Skipping
> > > > > provider "org.apache.commons.vfs.provider.smb.SmbFileProvider" because
> > > > > required class "jcifs.smb.SmbFile" is not available.
> > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current/homologene.data
> > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile: ftp://ftp.ncbi.nih.gov/
> > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current
> > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene
> > > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > > > ftp://ftp.ncbi.nih.gov/pub
> > > > > The file type is imaginary.
> > > > > 01-29@09: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 <ma...@ops.co.at> 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: user-unsubscribe@commons.apache.org
> > > > >> For additional commands, e-mail: user-help@commons.apache.org
> > > > >>
> > > > >>
> > > > >>
> > > > >
> > > > > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > > > For additional commands, e-mail: user-help@commons.apache.org
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > 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: mario@ops.co.at
> > > > Skype: mario_ivankovits
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > > For additional commands, e-mail: user-help@commons.apache.org
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > For additional commands, e-mail: user-help@commons.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > For additional commands, e-mail: user-help@commons.apache.org
> >
> >
>

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


Re: [vfs] Inconsistent Behavior...

Posted by James Carman <ja...@carmanconsulting.com>.
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 <se...@gmail.com> 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 <ja...@carmanconsulting.com> 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 <ma...@ops.co.at> 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:
> > > >
> > > > 01-29@09:18:11 INFO  (DefaultFileReplicator)     - Using
> > > > "C:\Users\jcarman\AppData\Local\Temp\vfs_cache" as temporary files
> > > > store.
> > > > 01-29@09:18:12 DEBUG (StandardFileSystemManager)     - Skipping
> > > > provider "org.apache.commons.vfs.provider.sftp.SftpFileProvider"
> > > > because required class "com.jcraft.jsch.JSch" is not available.
> > > > 01-29@09:18:12 DEBUG (StandardFileSystemManager)     - Skipping
> > > > provider "org.apache.commons.vfs.provider.smb.SmbFileProvider" because
> > > > required class "jcifs.smb.SmbFile" is not available.
> > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current/homologene.data
> > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile: ftp://ftp.ncbi.nih.gov/
> > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current
> > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene
> > > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > > ftp://ftp.ncbi.nih.gov/pub
> > > > The file type is imaginary.
> > > > 01-29@09: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 <ma...@ops.co.at> 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: user-unsubscribe@commons.apache.org
> > > >> For additional commands, e-mail: user-help@commons.apache.org
> > > >>
> > > >>
> > > >>
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > > For additional commands, e-mail: user-help@commons.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > 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: mario@ops.co.at
> > > Skype: mario_ivankovits
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > For additional commands, e-mail: user-help@commons.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > For additional commands, e-mail: user-help@commons.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

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


Re: [vfs] Inconsistent Behavior...

Posted by sebb <se...@gmail.com>.
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 <ja...@carmanconsulting.com> 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 <ma...@ops.co.at> 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:
> > >
> > > 01-29@09:18:11 INFO  (DefaultFileReplicator)     - Using
> > > "C:\Users\jcarman\AppData\Local\Temp\vfs_cache" as temporary files
> > > store.
> > > 01-29@09:18:12 DEBUG (StandardFileSystemManager)     - Skipping
> > > provider "org.apache.commons.vfs.provider.sftp.SftpFileProvider"
> > > because required class "com.jcraft.jsch.JSch" is not available.
> > > 01-29@09:18:12 DEBUG (StandardFileSystemManager)     - Skipping
> > > provider "org.apache.commons.vfs.provider.smb.SmbFileProvider" because
> > > required class "jcifs.smb.SmbFile" is not available.
> > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current/homologene.data
> > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile: ftp://ftp.ncbi.nih.gov/
> > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current
> > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > ftp://ftp.ncbi.nih.gov/pub/HomoloGene
> > > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > > ftp://ftp.ncbi.nih.gov/pub
> > > The file type is imaginary.
> > > 01-29@09: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 <ma...@ops.co.at> 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: user-unsubscribe@commons.apache.org
> > >> For additional commands, e-mail: user-help@commons.apache.org
> > >>
> > >>
> > >>
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > > For additional commands, e-mail: user-help@commons.apache.org
> > >
> > >
> >
> >
> > --
> > 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: mario@ops.co.at
> > Skype: mario_ivankovits
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > For additional commands, e-mail: user-help@commons.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

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


Re: [vfs] Inconsistent Behavior...

Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi!
> I'm not very well versed with Wireshark and the like.  Any pointers on
> what I should look for?
>   
Probably it is better to start with debugging in VFS.

In doAttach() you'll find getInfo() which in the end requests the
directory listing from the ftp server. For some reasons it seems the ftp
server somethings doesn't deliver the listing.

Ciao,
Mario


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


Re: [vfs] Inconsistent Behavior...

Posted by Torsten Curdt <tc...@apache.org>.
Well, you would need to follow the protocol conversations. But maybe  
just try the debugging first.

cheers
--
Torsten

On 29.01.2008, at 16:18, James Carman 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 <ma...@ops.co.at> 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:
>>>
>>> 01-29@09:18:11 INFO  (DefaultFileReplicator)     - Using
>>> "C:\Users\jcarman\AppData\Local\Temp\vfs_cache" as temporary files
>>> store.
>>> 01-29@09:18:12 DEBUG (StandardFileSystemManager)     - Skipping
>>> provider "org.apache.commons.vfs.provider.sftp.SftpFileProvider"
>>> because required class "com.jcraft.jsch.JSch" is not available.
>>> 01-29@09:18:12 DEBUG (StandardFileSystemManager)     - Skipping
>>> provider "org.apache.commons.vfs.provider.smb.SmbFileProvider"  
>>> because
>>> required class "jcifs.smb.SmbFile" is not available.
>>> 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
>>> ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current/homologene.data
>>> 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile: ftp:// 
>>> ftp.ncbi.nih.gov/
>>> 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
>>> ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current
>>> 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
>>> ftp://ftp.ncbi.nih.gov/pub/HomoloGene
>>> 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
>>> ftp://ftp.ncbi.nih.gov/pub
>>> The file type is imaginary.
>>> 01-29@09: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 <ma...@ops.co.at> 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: user-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: user-help@commons.apache.org
>>>>
>>>>
>>>>
>>>
>>> -------------------------------------------------------------------- 
>>> -
>>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: user-help@commons.apache.org
>>>
>>>
>>
>>
>> --
>> 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: mario@ops.co.at
>> Skype: mario_ivankovits
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>


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


Re: [vfs] Inconsistent Behavior...

Posted by James Carman <ja...@carmanconsulting.com>.
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 <ma...@ops.co.at> 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:
> >
> > 01-29@09:18:11 INFO  (DefaultFileReplicator)     - Using
> > "C:\Users\jcarman\AppData\Local\Temp\vfs_cache" as temporary files
> > store.
> > 01-29@09:18:12 DEBUG (StandardFileSystemManager)     - Skipping
> > provider "org.apache.commons.vfs.provider.sftp.SftpFileProvider"
> > because required class "com.jcraft.jsch.JSch" is not available.
> > 01-29@09:18:12 DEBUG (StandardFileSystemManager)     - Skipping
> > provider "org.apache.commons.vfs.provider.smb.SmbFileProvider" because
> > required class "jcifs.smb.SmbFile" is not available.
> > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current/homologene.data
> > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile: ftp://ftp.ncbi.nih.gov/
> > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current
> > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > ftp://ftp.ncbi.nih.gov/pub/HomoloGene
> > 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> > ftp://ftp.ncbi.nih.gov/pub
> > The file type is imaginary.
> > 01-29@09: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 <ma...@ops.co.at> 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: user-unsubscribe@commons.apache.org
> >> For additional commands, e-mail: user-help@commons.apache.org
> >>
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > For additional commands, e-mail: user-help@commons.apache.org
> >
> >
>
>
> --
> 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: mario@ops.co.at
> Skype: mario_ivankovits
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

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


Re: [vfs] Inconsistent Behavior...

Posted by Mario Ivankovits <ma...@ops.co.at>.
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:
>
> 01-29@09:18:11 INFO  (DefaultFileReplicator)     - Using
> "C:\Users\jcarman\AppData\Local\Temp\vfs_cache" as temporary files
> store.
> 01-29@09:18:12 DEBUG (StandardFileSystemManager)     - Skipping
> provider "org.apache.commons.vfs.provider.sftp.SftpFileProvider"
> because required class "com.jcraft.jsch.JSch" is not available.
> 01-29@09:18:12 DEBUG (StandardFileSystemManager)     - Skipping
> provider "org.apache.commons.vfs.provider.smb.SmbFileProvider" because
> required class "jcifs.smb.SmbFile" is not available.
> 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current/homologene.data
> 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile: ftp://ftp.ncbi.nih.gov/
> 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current
> 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> ftp://ftp.ncbi.nih.gov/pub/HomoloGene
> 01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
> ftp://ftp.ncbi.nih.gov/pub
> The file type is imaginary.
> 01-29@09: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 <ma...@ops.co.at> 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: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>>
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>   


-- 
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: mario@ops.co.at
Skype: mario_ivankovits


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


Re: [vfs] Inconsistent Behavior...

Posted by James Carman <ja...@carmanconsulting.com>.
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:

01-29@09:18:11 INFO  (DefaultFileReplicator)     - Using
"C:\Users\jcarman\AppData\Local\Temp\vfs_cache" as temporary files
store.
01-29@09:18:12 DEBUG (StandardFileSystemManager)     - Skipping
provider "org.apache.commons.vfs.provider.sftp.SftpFileProvider"
because required class "com.jcraft.jsch.JSch" is not available.
01-29@09:18:12 DEBUG (StandardFileSystemManager)     - Skipping
provider "org.apache.commons.vfs.provider.smb.SmbFileProvider" because
required class "jcifs.smb.SmbFile" is not available.
01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current/homologene.data
01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile: ftp://ftp.ncbi.nih.gov/
01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current
01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
ftp://ftp.ncbi.nih.gov/pub/HomoloGene
01-29@09:18:12 DEBUG (SoftRefFilesCache)     - putFile:
ftp://ftp.ncbi.nih.gov/pub
The file type is imaginary.
01-29@09: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 <ma...@ops.co.at> 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: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

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


Re: [vfs] Inconsistent Behavior...

Posted by Mario Ivankovits <ma...@ops.co.at>.
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: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [vfs] Inconsistent Behavior...

Posted by James Carman <ja...@carmanconsulting.com>.
Did you get my second email?  That's the entire output I got when I ran it.

On 1/29/08, Mario Ivankovits <ma...@ops.co.at> wrote:
> Hi!
> > 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)
> >
>
> Could you please post the whole stacktrace ... also the causes.
>
> Thanks!
>
> Ciao,
> Mario
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

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


Re: [vfs] Inconsistent Behavior...

Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi!
> 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)
>   

Could you please post the whole stacktrace ... also the causes.

Thanks!

Ciao,
Mario


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


Re: [vfs] Inconsistent Behavior...

Posted by James Carman <ja...@carmanconsulting.com>.
Here's the complete output in case that helps:

01-29@08:39:46 INFO  (DefaultFileReplicator)     - Using
"C:\Users\jcarman\AppData\Local\Temp\vfs_cache" as temporary files
store.
01-29@08:39:46 DEBUG (StandardFileSystemManager)     - Skipping
provider "org.apache.commons.vfs.provider.sftp.SftpFileProvider"
because required class "com.jcraft.jsch.JSch" is not available.
01-29@08:39:46 DEBUG (StandardFileSystemManager)     - Skipping
provider "org.apache.commons.vfs.provider.smb.SmbFileProvider" because
required class "jcifs.smb.SmbFile" is not available.
01-29@08:39:47 DEBUG (SoftRefFilesCache)     - putFile:
ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current/homologene.data
01-29@08:39:47 DEBUG (SoftRefFilesCache)     - putFile: ftp://ftp.ncbi.nih.gov/
01-29@08:39:47 DEBUG (SoftRefFilesCache)     - putFile:
ftp://ftp.ncbi.nih.gov/pub/HomoloGene/current
01-29@08:39:47 DEBUG (SoftRefFilesCache)     - putFile:
ftp://ftp.ncbi.nih.gov/pub/HomoloGene
01-29@08:39:47 DEBUG (SoftRefFilesCache)     - putFile:
ftp://ftp.ncbi.nih.gov/pub
01-29@08: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 <ja...@carmanconsulting.com> 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: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org