summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java
diff options
context:
space:
mode:
Diffstat (limited to 'dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java')
-rw-r--r--dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java22
1 files changed, 9 insertions, 13 deletions
diff --git a/dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java b/dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java
index 823d8894..0cb63429 100644
--- a/dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_GUI.java
+++ b/dozentenmodul/src/main/java/gui/image/FTPSearchDownloader_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;
@@ -81,8 +80,6 @@ public class FTPSearchDownloader_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 btnMainMenu = new JButton("Hauptmenü");
@@ -122,16 +119,15 @@ public class FTPSearchDownloader_GUI extends JFrame implements
if (choice == 0) {
try {
- client.DeleteFtpUser(user.userName,SessionData.session.getAuthToken());
+ 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();
}
- con.closeThriftConnection();
try {
- client.setSessionInvalid(SessionData.session.getAuthToken());
+ ThriftManager.getSatClient().setSessionInvalid(SessionData.session.getAuthToken());
} catch (TException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
@@ -147,7 +143,7 @@ public class FTPSearchDownloader_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();
@@ -432,7 +428,7 @@ public class FTPSearchDownloader_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("Deleted FTP user.");
} catch (TException e1) {
// TODO Auto-generated catch block
@@ -472,7 +468,7 @@ public class FTPSearchDownloader_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) {
// TODO Auto-generated catch block
e1.printStackTrace();
@@ -534,11 +530,11 @@ public class FTPSearchDownloader_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) {