Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
7.1k views
in Java FTP by
is it possible that if there is a file of the same name, and its set to resume..it wont append the contents of the modified file to the original half downloaded local file?

i read the docs that it does a byte by byte copy..so i hope that it deletes the old copy (with the same name) and overwrites it

like

myFTPClient.resume();
myFTPClient.get(path, filename);

thanks

4 Answers

0 votes
by
Sorry, let me reiterate

say you have and older file called "File.exe" which was created yesterday and is 100KB.

now the FTP also has a file called "File.exe" (102KB), its a different file altogether

if your code is set to download BINARY files using
myFTPClient.resume();
myFTPClient.get("File.exe");

will it append the last 2KB of the totally different File.exe onto the old File.exe??

i hope it overwrites it by default! its important that it does.
0 votes
by (162k points)
The last 2 KB of the new file will be downloaded and appended - that's what resume is for.

If you don't want yesterday's file, delete it before starting a download. Resume should be used when a download fails, leaving a partially downloaded file, e.g. if you get an IOException during the download.

Sorry, let me reiterate

say you have and older file called "File.exe" which was created yesterday and is 100KB.

now the FTP also has a file called "File.exe" (102KB), its a different file altogether

if your code is set to download BINARY files using
myFTPClient.resume();
myFTPClient.get("File.exe");

will it append the last 2KB of the totally different File.exe onto the old File.exe??

i hope it overwrites it by default! its important that it does.
0 votes
by
That sucks :P

what if the clients exits out of the program/or computer crashes/etc with a partially downloaded file and the file is of significant size? still should delete and start over?

only use resume during current download session?
0 votes
by (162k points)
The FTP client has no way of determining whether you want the partial file or not - using resume signals that you do want it. If you want to delete files with the previous day's date, go ahead and do that before you download.

The only way to tell if the already downloaded content is different from that of the file you are downloading would be to download the entire file - exactly what resume is trying to avoid.

It is probably sensible to use resume on downloads that fail in the current session - although this is not a restriction on how it is used.


That sucks :P

what if the clients exits out of the program/or computer crashes/etc with a partially downloaded file and the file is of significant size? still should delete and start over?

only use resume during current download session?

Categories

...