How can I make sure the thread has completed work?
You call Thread.join()as follows:
...
Thread t = new Thread(new FTPFileSender(pasvHost, pasvPort, fileToSend));
t.start();
t.join();
Please note that it Thread.joinwill be blocked until the completion of another thread.
, , upload UploadThread, , . , , addUploadListener , . - :
UploadThread ut = new UploadThread(...);
ut.addUploadListener(new UploadListener() {
public void uploadComplete() {
System.out.println("Upload completed.");
}
});
ut.start();