Jakarta common/net FTP - setRestartOffset - Upload Resume...
- From: "KGuru" <mygooglenewsgroups@xxxxxxxxxxx>
- Date: 21 Mar 2006 23:55:00 -0800
Hi all,
I have tried to understand how to resume an upload or download using
the FTPClient API from Jakarta common net libraries.
1- I started by uploading a file on the FTP server then I interupted
the upload in the middle (after for example 790000 bytes) :
FTPClient ftp=new FTPClient();
....
input = new FileInputStream("fileSourceName");
output = ftp.storeFileStream("fileTargetName");
....
Util.copyStream(input, output);
2- I restart the program but I have added a line of code that describe
an offset:
FTPClient ftp=new FTPClient();
ftp.setRestartOffset(790000);
3- I was expecting that the download will restart from the offset
instead the file upload starts from beginning...
a- In fact i checked the Util.copystream method, i cannot see any use
of the offset or is it simply handled by the FTP server?
b-I'm just wonderinfg thatif it is handled by the FTP server,
how does the FTP server knows where to start etc.. if the connection is
restarted...
c-if anyone has succesfully written the code that handles the "resume"
functionnality, it would be nice to see some code snippet.
Many Thanks!
.
- Follow-Ups:
- Re: Jakarta common/net FTP - setRestartOffset - Upload Resume...
- From: Thomas Weidenfeller
- Re: Jakarta common/net FTP - setRestartOffset - Upload Resume...
- Prev by Date: Re: List all existing timer tasks
- Next by Date: Re: why java is not pure object oriented?
- Previous by thread: can i confiugure a protocol provider for tomcat?
- Next by thread: Re: Jakarta common/net FTP - setRestartOffset - Upload Resume...
- Index(es):
Relevant Pages
|