Mario,
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()
{
try
{
createStream();
}
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.VFS.getManager();
org.apache.commons.vfs.FileObject fo = fs.resolveFile("ftp://ibiblio.org/README");
org.apache.commons.vfs.RandomAccessContent content = fo.getContent().getRandomAccessContent(org.apache.commons.vfs.util.RandomAccessMode.READ);
content.seek(50);
java.io.InputStream in = content.getInputStream();
org.apache.commons.net.io.Util.copyStream(in,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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--
=====================================================================
Jeffrey D. Brekke [EMAIL PROTECTED]
Wisconsin, USA [EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
