1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
package sftp;
import java.io.IOException;
import java.net.UnknownHostException;
// Classe permettant le transfert d'un fichier depuis le dossier local courant
// vers le FTP
public class upload extends Thread implements Runnable {
public upload(String toUp) {
this.toUp = toUp; // recuperation du nom de fichier a envoyer sur le FTP
}
public void run(){
try {
MVCView.ftp.uploadFile(toUp); // envoie sur le FTP
MVCView.refreshFTP(); // reactualisation de la fenetre
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
public String toUp;
} |