commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeffrey D. Brekke" <>
Subject Re: [VFS] ranged downloads?
Date Thu, 17 Feb 2005 04:58:48 GMT

I was just testing some stuff out against ftp servers on the internet 
and noticed that getInputStream() on FtpRandomAccessContent doesn't call 
createStream() so I'm getting NPE since I don't do any of the other 
readXXX methods.  I'll try out some more stuff tomorrow at work against 
our servers.  Here's my fugly change to that method ( since it isn't 
allowed to throw checked exceptions ), you probably have a much better 
idea for this:

public InputStream getInputStream()
   catch (IOException e)
     throw new RuntimeException(e);
   return dis;

Once in place my simple test worked ( forgive the FQN's, I was trying 
out Eclipse's Scrapbook pages for this ):

org.apache.commons.vfs.FileSystemManager fs = 

org.apache.commons.vfs.FileObject fo = 

org.apache.commons.vfs.RandomAccessContent content = 
fo.getContent().getRandomAccessContent(org.apache.commons.vfs.util.RandomAccessMode.READ);; in = content.getInputStream();,System.out);


Mario Ivankovits wrote:
> Jeffrey D. Brekke wrote:
>> If you get something committed, like some tests, I could try here...
> Its done now. It would be nice if you could test it against your sever.
> Thanks!
> Mario
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Jeffrey D. Brekke                         
Wisconsin,  USA                           

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message