diff options
Diffstat (limited to 'dozentenmodul/src/main/java/gui/image/FTPEditDownloader_GUI.java')
| -rw-r--r-- | dozentenmodul/src/main/java/gui/image/FTPEditDownloader_GUI.java | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/dozentenmodul/src/main/java/gui/image/FTPEditDownloader_GUI.java b/dozentenmodul/src/main/java/gui/image/FTPEditDownloader_GUI.java index d190c50f..6db115fb 100644 --- a/dozentenmodul/src/main/java/gui/image/FTPEditDownloader_GUI.java +++ b/dozentenmodul/src/main/java/gui/image/FTPEditDownloader_GUI.java @@ -42,10 +42,9 @@ import models.person; import org.apache.log4j.Logger; import org.apache.thrift.TException; -import org.openslx.sat.thrift.iface.Server.Client; import org.openslx.sat.thrift.iface.User; -import thrift.ThriftConnection; +import thrift.ThriftManager; import util.OpenLinks; import config.Config; import ftp.DownloadTask; @@ -84,8 +83,6 @@ public class FTPEditDownloader_GUI extends JFrame implements long bytesread; JLabel lblZeit; boolean taskrun = false; - ThriftConnection con = new ThriftConnection(); - Client client = models.Client.clientcon.getClient(); JButton btnZurck = new JButton("Zurück"); JButton btnDownloadStarten = new JButton("Download starten"); JButton btnDownloadStoppen = new JButton("Download abbrechen"); @@ -123,10 +120,9 @@ public class FTPEditDownloader_GUI extends JFrame implements // 0=beenden, 1=abbrechen if (choice == 0) { try { - client.DeleteFtpUser(user.userName,SessionData.session.getAuthToken()); - con.closeThriftConnection(); + ThriftManager.getSatClient().DeleteFtpUser(user.userName,SessionData.session.getAuthToken()); try { - client.setSessionInvalid(SessionData.session.getAuthToken()); + ThriftManager.getSatClient().setSessionInvalid(SessionData.session.getAuthToken()); } catch (TException e1) { // TODO Auto-generated catch block e1.printStackTrace(); @@ -141,7 +137,7 @@ public class FTPEditDownloader_GUI extends JFrame implements } else { // no download running, close window try { - client.setSessionInvalid(SessionData.session.getAuthToken()); + ThriftManager.getSatClient().setSessionInvalid(SessionData.session.getAuthToken()); } catch (TException e1) { // TODO Auto-generated catch block e1.printStackTrace(); @@ -426,7 +422,7 @@ public class FTPEditDownloader_GUI extends JFrame implements isAborted = true; // set flag try { - client.DeleteFtpUser(user.userName,SessionData.session.getAuthToken()); + ThriftManager.getSatClient().DeleteFtpUser(user.userName,SessionData.session.getAuthToken()); LOGGER.info("FTP user deleted."); } catch (TException e1) { @@ -465,7 +461,7 @@ public class FTPEditDownloader_GUI extends JFrame implements if (choice == 0) { task.cancel(true); try { - client.DeleteFtpUser(user.userName,SessionData.session.getAuthToken()); + ThriftManager.getSatClient().DeleteFtpUser(user.userName,SessionData.session.getAuthToken()); } catch (TException e1) { e1.printStackTrace(); @@ -527,11 +523,11 @@ public class FTPEditDownloader_GUI extends JFrame implements // Klick btnDownloadStarten.setText("Bitte warten"); try { - user = client.getFtpUser(SessionData.session.getAuthToken()); + user = ThriftManager.getSatClient().getFtpUser(SessionData.session.getAuthToken()); downloadFile = user.path + "/" - + client.getPathOfImage(Image.image.getImageId(), + + ThriftManager.getSatClient().getPathOfImage(Image.image.getImageId(), Image.image.getVersion(),SessionData.session.getAuthToken()); } catch (TException e) { |
