From f1fdca5246cce4c4c86a7fbb1418f1c758ed6175 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 31 Jan 2014 15:34:22 +0100 Subject: Up - und Download funktionieren nun, wichtig im Dozentenmodul muss der volle Serverpfad angegeben sein. --- Dozentenmodul/bin/GUI/ActionChooser$2.class | Bin 1127 -> 1127 bytes Dozentenmodul/bin/GUI/ActionChooser.class | Bin 5504 -> 5494 bytes Dozentenmodul/bin/GUI/FTPDownloader$1.class | Bin 844 -> 1221 bytes Dozentenmodul/bin/GUI/FTPDownloader$2.class | Bin 1187 -> 1187 bytes Dozentenmodul/bin/GUI/FTPDownloader$3.class | Bin 750 -> 750 bytes Dozentenmodul/bin/GUI/FTPDownloader$4.class | Bin 871 -> 1247 bytes Dozentenmodul/bin/GUI/FTPDownloader.class | Bin 7114 -> 7944 bytes Dozentenmodul/bin/GUI/FTPUploader$1.class | Bin 718 -> 718 bytes Dozentenmodul/bin/GUI/FTPUploader$2.class | Bin 1148 -> 1148 bytes Dozentenmodul/bin/GUI/FTPUploader$3.class | Bin 1288 -> 1288 bytes Dozentenmodul/bin/GUI/FTPUploader$4.class | Bin 707 -> 707 bytes Dozentenmodul/bin/GUI/FTPUploader$5.class | Bin 1203 -> 1203 bytes Dozentenmodul/bin/GUI/FTPUploader.class | Bin 7598 -> 7598 bytes Dozentenmodul/bin/GUI/searchRohling.class | Bin 6960 -> 6592 bytes Dozentenmodul/bin/downloader/FTPUtility.class | Bin 5174 -> 5174 bytes .../downloader/jschtest$HardcodedUserInfo.class | Bin 1443 -> 0 bytes Dozentenmodul/bin/downloader/jschtest.class | Bin 2707 -> 0 bytes Dozentenmodul/src/GUI/ActionChooser.java | 1 - Dozentenmodul/src/GUI/FTPDownloader.java | 37 ++++++++- Dozentenmodul/src/GUI/FTPUploader.java | 13 +--- Dozentenmodul/src/GUI/searchRohling.java | 78 ++++++++----------- Dozentenmodul/src/downloader/FTPUtility.java | 4 - Dozentenmodul/src/downloader/jschtest.java | 84 --------------------- .../bin/server/ServerInterface.class | Bin 291 -> 489 bytes Dozentenmodulserver/bin/server/ServerMethod.class | Bin 3106 -> 4281 bytes Dozentenmodulserver/bin/sql/SQL.class | Bin 2372 -> 3051 bytes .../src/server/ServerInterface.java | 5 +- Dozentenmodulserver/src/server/ServerMethod.java | 48 +++++++++++- Dozentenmodulserver/src/sql/SQL.java | 35 ++++++++- 29 files changed, 152 insertions(+), 153 deletions(-) delete mode 100644 Dozentenmodul/bin/downloader/jschtest$HardcodedUserInfo.class delete mode 100644 Dozentenmodul/bin/downloader/jschtest.class delete mode 100644 Dozentenmodul/src/downloader/jschtest.java diff --git a/Dozentenmodul/bin/GUI/ActionChooser$2.class b/Dozentenmodul/bin/GUI/ActionChooser$2.class index 986d5e43..b759b25e 100644 Binary files a/Dozentenmodul/bin/GUI/ActionChooser$2.class and b/Dozentenmodul/bin/GUI/ActionChooser$2.class differ diff --git a/Dozentenmodul/bin/GUI/ActionChooser.class b/Dozentenmodul/bin/GUI/ActionChooser.class index 3c9d4d89..378f708a 100644 Binary files a/Dozentenmodul/bin/GUI/ActionChooser.class and b/Dozentenmodul/bin/GUI/ActionChooser.class differ diff --git a/Dozentenmodul/bin/GUI/FTPDownloader$1.class b/Dozentenmodul/bin/GUI/FTPDownloader$1.class index 1660d1a1..b97f479a 100644 Binary files a/Dozentenmodul/bin/GUI/FTPDownloader$1.class and b/Dozentenmodul/bin/GUI/FTPDownloader$1.class differ diff --git a/Dozentenmodul/bin/GUI/FTPDownloader$2.class b/Dozentenmodul/bin/GUI/FTPDownloader$2.class index 297f1c45..3114758a 100644 Binary files a/Dozentenmodul/bin/GUI/FTPDownloader$2.class and b/Dozentenmodul/bin/GUI/FTPDownloader$2.class differ diff --git a/Dozentenmodul/bin/GUI/FTPDownloader$3.class b/Dozentenmodul/bin/GUI/FTPDownloader$3.class index 1856b309..1804e5a1 100644 Binary files a/Dozentenmodul/bin/GUI/FTPDownloader$3.class and b/Dozentenmodul/bin/GUI/FTPDownloader$3.class differ diff --git a/Dozentenmodul/bin/GUI/FTPDownloader$4.class b/Dozentenmodul/bin/GUI/FTPDownloader$4.class index 5075949c..95a47553 100644 Binary files a/Dozentenmodul/bin/GUI/FTPDownloader$4.class and b/Dozentenmodul/bin/GUI/FTPDownloader$4.class differ diff --git a/Dozentenmodul/bin/GUI/FTPDownloader.class b/Dozentenmodul/bin/GUI/FTPDownloader.class index f5ff4747..5e40b98e 100644 Binary files a/Dozentenmodul/bin/GUI/FTPDownloader.class and b/Dozentenmodul/bin/GUI/FTPDownloader.class differ diff --git a/Dozentenmodul/bin/GUI/FTPUploader$1.class b/Dozentenmodul/bin/GUI/FTPUploader$1.class index 663a8846..eb35f67d 100644 Binary files a/Dozentenmodul/bin/GUI/FTPUploader$1.class and b/Dozentenmodul/bin/GUI/FTPUploader$1.class differ diff --git a/Dozentenmodul/bin/GUI/FTPUploader$2.class b/Dozentenmodul/bin/GUI/FTPUploader$2.class index efbfd432..947c4bfc 100644 Binary files a/Dozentenmodul/bin/GUI/FTPUploader$2.class and b/Dozentenmodul/bin/GUI/FTPUploader$2.class differ diff --git a/Dozentenmodul/bin/GUI/FTPUploader$3.class b/Dozentenmodul/bin/GUI/FTPUploader$3.class index b00dc547..a2c03bb7 100644 Binary files a/Dozentenmodul/bin/GUI/FTPUploader$3.class and b/Dozentenmodul/bin/GUI/FTPUploader$3.class differ diff --git a/Dozentenmodul/bin/GUI/FTPUploader$4.class b/Dozentenmodul/bin/GUI/FTPUploader$4.class index 1f329752..e4bc53ff 100644 Binary files a/Dozentenmodul/bin/GUI/FTPUploader$4.class and b/Dozentenmodul/bin/GUI/FTPUploader$4.class differ diff --git a/Dozentenmodul/bin/GUI/FTPUploader$5.class b/Dozentenmodul/bin/GUI/FTPUploader$5.class index 1e96a33d..10020730 100644 Binary files a/Dozentenmodul/bin/GUI/FTPUploader$5.class and b/Dozentenmodul/bin/GUI/FTPUploader$5.class differ diff --git a/Dozentenmodul/bin/GUI/FTPUploader.class b/Dozentenmodul/bin/GUI/FTPUploader.class index 0f80542b..1a25bc45 100644 Binary files a/Dozentenmodul/bin/GUI/FTPUploader.class and b/Dozentenmodul/bin/GUI/FTPUploader.class differ diff --git a/Dozentenmodul/bin/GUI/searchRohling.class b/Dozentenmodul/bin/GUI/searchRohling.class index 5f0113fd..5ae1d551 100644 Binary files a/Dozentenmodul/bin/GUI/searchRohling.class and b/Dozentenmodul/bin/GUI/searchRohling.class differ diff --git a/Dozentenmodul/bin/downloader/FTPUtility.class b/Dozentenmodul/bin/downloader/FTPUtility.class index f5a5dd90..33125b5c 100644 Binary files a/Dozentenmodul/bin/downloader/FTPUtility.class and b/Dozentenmodul/bin/downloader/FTPUtility.class differ diff --git a/Dozentenmodul/bin/downloader/jschtest$HardcodedUserInfo.class b/Dozentenmodul/bin/downloader/jschtest$HardcodedUserInfo.class deleted file mode 100644 index 02818b1a..00000000 Binary files a/Dozentenmodul/bin/downloader/jschtest$HardcodedUserInfo.class and /dev/null differ diff --git a/Dozentenmodul/bin/downloader/jschtest.class b/Dozentenmodul/bin/downloader/jschtest.class deleted file mode 100644 index 8d06f1fe..00000000 Binary files a/Dozentenmodul/bin/downloader/jschtest.class and /dev/null differ diff --git a/Dozentenmodul/src/GUI/ActionChooser.java b/Dozentenmodul/src/GUI/ActionChooser.java index f469878d..b5769ba7 100644 --- a/Dozentenmodul/src/GUI/ActionChooser.java +++ b/Dozentenmodul/src/GUI/ActionChooser.java @@ -113,7 +113,6 @@ public class ActionChooser extends JFrame { contentPanel.add(rdbtnLaborvorlageHerunterladen); JRadioButton rdbtnEigenschaftenEinerVl = new JRadioButton("Fertiges Labor hochladen"); - rdbtnEigenschaftenEinerVl.setEnabled(false); buttonGroup.add(rdbtnEigenschaftenEinerVl); rdbtnEigenschaftenEinerVl.setBackground(Color.WHITE); rdbtnEigenschaftenEinerVl.setBounds(6, 53, 185, 23); diff --git a/Dozentenmodul/src/GUI/FTPDownloader.java b/Dozentenmodul/src/GUI/FTPDownloader.java index a8ed8785..796e3798 100644 --- a/Dozentenmodul/src/GUI/FTPDownloader.java +++ b/Dozentenmodul/src/GUI/FTPDownloader.java @@ -6,6 +6,8 @@ import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Toolkit; import java.io.File; +import java.rmi.RemoteException; + import javax.swing.JButton; import javax.swing.JFileChooser; import javax.swing.JFrame; @@ -16,6 +18,11 @@ import javax.swing.SwingConstants; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import javax.swing.border.EmptyBorder; + +import Models.User; + +import rmi.RmiClientMethods; +import server.ServerInterface; import downloader.DownloadTask; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; @@ -32,8 +39,9 @@ public class FTPDownloader extends JFrame implements PropertyChangeListener { private final JPanel contentPanel = new JPanel(); JLabel lblNewLabel; JLabel downspeed; + User user; JProgressBar progressBar; - String host="132.230.4.16"; + String host="141.79.128.121"; int port=21; String username="openslx"; String password="openslx-ng"; @@ -49,6 +57,8 @@ public class FTPDownloader extends JFrame implements PropertyChangeListener { long bytesread; JLabel labelZeit; boolean taskrun=false; + RmiClientMethods rmi=new RmiClientMethods(); + ServerInterface sint=rmi.getInterface(); /** * Launch the application. */ @@ -74,6 +84,12 @@ public class FTPDownloader extends JFrame implements PropertyChangeListener { public void windowClosing(WindowEvent e) { if(taskrun==true) { + try { + sint.DeleteFtpUser(user.getUsername()); + } catch (RemoteException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } task.cancel(true); } dispose(); @@ -196,6 +212,12 @@ public class FTPDownloader extends JFrame implements PropertyChangeListener { if(taskrun==true) { task.cancel(true); + try { + sint.DeleteFtpUser(user.getUsername()); + } catch (RemoteException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } } dispose(); } @@ -211,7 +233,18 @@ public class FTPDownloader extends JFrame implements PropertyChangeListener { private void buttonDownloadActionPerformed(ActionEvent event) { progressBar.setValue(0); - task = new DownloadTask(host, port, username, password,downloadPath+filename, lblNewLabel.getText(), this); + + try { + user=sint.getFtpUser(); + downloadPath=sint.getPathOfImage(filename); + } catch (RemoteException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + System.out.println(user.getUsername()+"Pass:"+user.getPass()); + + task = new DownloadTask(host, port, user.getUsername(), user.getPass(),downloadPath+filename+".vmdk", lblNewLabel.getText(), this); + System.out.println(downloadPath+filename); task.addPropertyChangeListener(this); task.execute(); taskrun=true; diff --git a/Dozentenmodul/src/GUI/FTPUploader.java b/Dozentenmodul/src/GUI/FTPUploader.java index f1552be4..f92fa172 100644 --- a/Dozentenmodul/src/GUI/FTPUploader.java +++ b/Dozentenmodul/src/GUI/FTPUploader.java @@ -3,19 +3,13 @@ package GUI; import java.awt.BorderLayout; import rmi.*; import server.ServerInterface; - import java.awt.Color; import java.awt.Dimension; import java.awt.EventQueue; import java.awt.FlowLayout; import java.awt.Toolkit; -import java.io.BufferedReader; import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; import java.rmi.RemoteException; -import java.util.Properties; import javax.swing.JButton; import javax.swing.JFileChooser; import javax.swing.JFrame; @@ -26,12 +20,6 @@ import javax.swing.SwingConstants; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import javax.swing.border.EmptyBorder; -import com.jcraft.jsch.ChannelExec; -import com.jcraft.jsch.JSch; -import com.jcraft.jsch.JSchException; -import com.jcraft.jsch.Session; -import Models.person; -import Models.vm; import downloader.UploadTask; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; @@ -40,6 +28,7 @@ import java.beans.PropertyChangeListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import Models.User; + @SuppressWarnings("serial") public class FTPUploader extends JFrame implements PropertyChangeListener { diff --git a/Dozentenmodul/src/GUI/searchRohling.java b/Dozentenmodul/src/GUI/searchRohling.java index 807fc7b3..e0c0a9ba 100644 --- a/Dozentenmodul/src/GUI/searchRohling.java +++ b/Dozentenmodul/src/GUI/searchRohling.java @@ -19,7 +19,11 @@ import javax.swing.JTextField; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.net.SocketException; +import java.rmi.RemoteException; import java.security.NoSuchAlgorithmException; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; import java.awt.List; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; @@ -35,18 +39,24 @@ import java.awt.event.WindowEvent; import javax.swing.JComboBox; import javax.swing.DefaultComboBoxModel; +import rmi.RmiClientMethods; +import server.ServerInterface; + +import Models.User; + @SuppressWarnings("serial") public class searchRohling extends JFrame { private final JPanel contentPanel = new JPanel(); private JTextField textFieldsearch; List list; - String[] result; - String host="132.230.4.16"; + ArrayList result; + String host="141.79.128.121"; + User user; int port=21; - String user="openslx"; - String pass="openslx-ng"; - FTPUtility f=new FTPUtility(host, port, user, pass); + RmiClientMethods rmi=new RmiClientMethods(); + ServerInterface sint=rmi.getInterface(); + //FTPUtility f=new FTPUtility(host, port, user.getUsername(), user.getPass()); /** * Launch the application. */ @@ -63,7 +73,7 @@ public class searchRohling extends JFrame { /** * Create the dialog. */ - @SuppressWarnings({ "unchecked", "rawtypes" }) + public searchRohling() { getContentPane().setEnabled(false); addWindowListener(new WindowAdapter() { @@ -105,14 +115,14 @@ public class searchRohling extends JFrame { txtpnBitteWhlenSie.setBounds(10, 36, 509, 42); panel.add(txtpnBitteWhlenSie); } - contentPanel.setBounds(10, 152, 567, 420); + contentPanel.setBounds(10, 126, 567, 446); contentPanel.setBackground(Color.WHITE); contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); getContentPane().add(contentPanel); contentPanel.setLayout(null); list = new List(); - list.setBounds(0, 10, 567, 400); + list.setBounds(10, 10, 547, 426); contentPanel.add(list); { JPanel buttonPane = new JPanel(); @@ -161,21 +171,8 @@ public class searchRohling extends JFrame { textFieldsearch.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent arg0) { - System.out.println(textFieldsearch.getText().toString()); - - try { - try { - f.connect(); - } catch (NoSuchAlgorithmException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - result=f.getAllRohling(textFieldsearch.getText().toString()); - } catch (SocketException | FTPException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - list.removeAll(); + System.out.println(textFieldsearch.getText().toString());}} + /*list.removeAll(); for(int i=0;i