commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Ivankovits <ma...@ops.co.at>
Subject Re: [vfs] Restart function by using Commons VFS
Date Thu, 06 Oct 2005 08:41:22 GMT
Hi!

erwan.foll@libertysurf.fr wrote:
>1- Is it possible to perform FTP restart function when using
>VFS api ? (I know that the restart function is available in
>COMMONS NET by using the setRestartOffset(long offset) 
>method of the FTPClient class)
>  
You can use the RandomAccessContent:

        FileObject fo = VFS.getManager().resolveFile("ftp://...");
        RandomAccessContent rac = 
fo.getContent().getRandomAccessContent(RandomAccessMode.READ);
        rac.seek(4711);

If you need a InputStream you can aquire one by using:
        InputStream is = rac.getInputStream();


>2- Is it possible to perform SFTP restart function when
>using VFS api ? (I don't know if  the restart function is
>available in Jcraft Jsch)
>  
The newest version of jsch allows such a "restart", but its current api 
isnt backward compatible so I cant drop it into VFS now.
Once this has been done you will use the same code as above.


Ciao,
Mario


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


Mime
View raw message