> 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?
[quoted text clipped - 5 lines]
> c-if anyone has succesfully written the code that handles the "resume"
> functionnality, it would be nice to see some code snippet.
Like always in such cases (maybe we should make a
mini-networking-debugging-FAQ out of this):
1) Sniff the network with a tool like Ethereal, snoop, or whatever to
see what is really going on on the network
2) Check the documentation of the server if and how it supports resuming
some transfer, and with which protocol (part).
3) Get a copy of the relevant RFC(s) to check if and how the protocol
should work and is actually used.
/Thomas

Signature
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
KGuru - 23 Mar 2006 08:23 GMT
Thanks fo your answer,
I was doing all the research and debug you are mentionning. I'm just
looking for someone who had experience the same type of problems and
how it was solved.
One discovery I made was that the FTP server was not supporting FTP
command such as : REST and SIZE command send by the API in order to
resume the upload.
Best regards
KGuru
KGuru - 23 Mar 2006 10:43 GMT
I think there is a bug in the common-net FTP Jakarta component, in the
Util package.
by adding the following line of code in the Util package in the
copyStream method:
try {
----->>> source.skip(offset); <<<<-----
while ((bytes = source.read(buffer)) != -1) {
the offset represents the size of the file on the server which is
returned by the following code (as i can't find the fileSize
method...): ftpfiles is returned by
ftp.initiateListParsing().getFiles().
for(int i=0; i<ftpFiles.length;i++){
if (ftpFiles[i].getName().equalsIgnoreCase(filename)){
return ftpFiles[i].getSize();
}
}
of course there was a need to set at the beginning og the code:
ftp.setRestartOffset(offset);
I'm not sure i'm clear ;> but I hope one has understood the logic. Is
there any better idea???
Br,
KGuru
Thomas Weidenfeller - 23 Mar 2006 12:23 GMT
> I was doing all the research and debug you are mentionning.
How should we know if you don't mention this in your first post?
> One discovery I made was that the FTP server was not supporting FTP
> command such as : REST and SIZE command send by the API in order to
> resume the upload.
So you know your answer: Use another FTP server.
/Thomas

Signature
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/