diff options
Diffstat (limited to 'Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java')
| -rw-r--r-- | Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java b/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java index f36a4c5d..3adb426a 100644 --- a/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java @@ -36,6 +36,7 @@ import javax.swing.UnsupportedLookAndFeelException; import javax.swing.border.EmptyBorder; import models.Image; import models.Links; +import models.SessionData; import models.person; import org.apache.thrift.TException; import server.Server.Client; @@ -56,8 +57,7 @@ public class FTPCreateUploader_GUI extends JFrame implements private final JPanel contentPanel = new JPanel(); JLabel lblPath; JProgressBar progressBar; - //String host = "141.79.128.121"; - String host = "141.79.128.102"; + String host = SessionData.session.getServerAdress(); int port = 21; server.User user; String filename = ""; @@ -73,8 +73,8 @@ public class FTPCreateUploader_GUI extends JFrame implements double speed; long bytesread; boolean taskrun = false; - ThriftConnection thrift = new ThriftConnection(); - Client client = thrift.getThriftConnection(); + ThriftConnection con = new ThriftConnection(); + Client client = models.Client.clientcon.getClient(); JButton finishButton = new JButton("Fertigstellen"); JButton btnUploadStarten = new JButton("Upload auf Server starten"); JButton btnZurck = new JButton("Zur\u00FCck"); @@ -115,6 +115,7 @@ public class FTPCreateUploader_GUI extends JFrame implements } task.cancel(true); } + con.closeThriftConnection(); System.exit(0); }// end window closing }); @@ -332,7 +333,7 @@ public class FTPCreateUploader_GUI extends JFrame implements if (taskrun == true) { try { client.DeleteFtpUser(user.userName); - thrift.closeThriftConnection(); + } catch (TException e1) { // TODO Auto-generated catch block e1.printStackTrace(); @@ -349,7 +350,7 @@ public class FTPCreateUploader_GUI extends JFrame implements btnZurck.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { dispose(); - thrift.closeThriftConnection(); + CreateImageTechnisch_GUI m = new CreateImageTechnisch_GUI(); m.setVisible(true); } @@ -405,6 +406,7 @@ public class FTPCreateUploader_GUI extends JFrame implements btnUploadStarten.setText("Bitte warten"); try { + System.out.println("Test"); user = client.getFtpUser(); System.out.println("FTP name" + user.userName); System.out.println("FTP path" + user.path); @@ -426,6 +428,8 @@ public class FTPCreateUploader_GUI extends JFrame implements + person.verantwortlicher.getHochschule() + "_" + person.verantwortlicher.getUsername() + "_" + Image.image.getImagename() + ".vmdk"); + System.out.println("Uploading to host: "+host); + task = new UploadTask(host, port, user.userName, user.password, user.path+"temp/", uploadFile); @@ -510,7 +514,7 @@ public class FTPCreateUploader_GUI extends JFrame implements person.verantwortlicher.getHochschule(), person.verantwortlicher.getEMail(), person.verantwortlicher.getTel(), - person.verantwortlicher.getFakultät(), + person.verantwortlicher.getFakultaet(), Image.image.isLicensed(), Image.image.isInternet(), Image.image.getRam(), Image.image.getCpu(), "temp/" + Image.image.getNewName(),false,Image.image.getFilesize()); |
