S
Susanne Kaufmann
I have an applet which Downloads some files from an FTP(S) Server.
Mostly everything works fine, but sometimes the application "stops"
for a long time (several minutes) after the "RETR filename" command.
PErhaps someone knows this problem or has an idea.
Thank you in advance for any hint,
Susanne
Here is some of my code:
try {
InputStream stO =
new BufferedInputStream(
ftps.retrieveFileStream(fileName),
ftps.getBufferSize());
org.apache.commons.net.io.Util.copyStream(
stO,
fout,
ftps.getBufferSize(),
//
org.apache.commons.net.io.CopyStreamEvent.UNKNOWN_STREAM_SIZE,
length,
new org.apache.commons.net.io.CopyStreamAdapter() {
public void bytesTransferred(long
totalBytesTransferred,
int bytesTransferred,
long streamSize) {
changeSupport.firePropertyChange(FTPPERCENT, null,
totalBytesTransferred*100/length);
}
});
} catch (Exception e) {
e.printStackTrace();
}
Mostly everything works fine, but sometimes the application "stops"
for a long time (several minutes) after the "RETR filename" command.
PErhaps someone knows this problem or has an idea.
Thank you in advance for any hint,
Susanne
Here is some of my code:
try {
InputStream stO =
new BufferedInputStream(
ftps.retrieveFileStream(fileName),
ftps.getBufferSize());
org.apache.commons.net.io.Util.copyStream(
stO,
fout,
ftps.getBufferSize(),
//
org.apache.commons.net.io.CopyStreamEvent.UNKNOWN_STREAM_SIZE,
length,
new org.apache.commons.net.io.CopyStreamAdapter() {
public void bytesTransferred(long
totalBytesTransferred,
int bytesTransferred,
long streamSize) {
changeSupport.firePropertyChange(FTPPERCENT, null,
totalBytesTransferred*100/length);
}
});
} catch (Exception e) {
e.printStackTrace();
}