summaryrefslogtreecommitdiffstats
path: root/Dozentenmodul/src/gui/image/FTPEditDownloader_GUI.java
diff options
context:
space:
mode:
authorTobias Spitzer2014-08-25 14:32:25 +0200
committerTobias Spitzer2014-08-25 14:32:25 +0200
commitcfce5baa25dcd864f8d4c2b44d5d0102a39e1570 (patch)
tree7ff0c8341d5e6101d8af700a670e119dbd68f974 /Dozentenmodul/src/gui/image/FTPEditDownloader_GUI.java
parentKonfigdatei wird beim ändern des Logins zurückgesetzt (diff)
downloadtutor-module-cfce5baa25dcd864f8d4c2b44d5d0102a39e1570.tar.gz
tutor-module-cfce5baa25dcd864f8d4c2b44d5d0102a39e1570.tar.xz
tutor-module-cfce5baa25dcd864f8d4c2b44d5d0102a39e1570.zip
Uploadpfad speichern
Diffstat (limited to 'Dozentenmodul/src/gui/image/FTPEditDownloader_GUI.java')
-rw-r--r--Dozentenmodul/src/gui/image/FTPEditDownloader_GUI.java48
1 files changed, 47 insertions, 1 deletions
diff --git a/Dozentenmodul/src/gui/image/FTPEditDownloader_GUI.java b/Dozentenmodul/src/gui/image/FTPEditDownloader_GUI.java
index e03d07a3..1a4b387e 100644
--- a/Dozentenmodul/src/gui/image/FTPEditDownloader_GUI.java
+++ b/Dozentenmodul/src/gui/image/FTPEditDownloader_GUI.java
@@ -15,6 +15,7 @@ import java.awt.event.WindowEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.File;
+import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
@@ -40,6 +41,8 @@ import models.Links;
import models.SessionData;
import org.apache.thrift.TException;
+import org.ini4j.InvalidFileFormatException;
+import org.ini4j.Wini;
import server.Server.Client;
import server.User;
@@ -151,6 +154,21 @@ public class FTPEditDownloader_GUI extends JFrame implements
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
fc.showOpenDialog(getParent());
+ try {
+ Wini ini = new Wini(
+ new File(
+ "C:\\Users\\"
+ + System.getProperty("user.name")
+ + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini"));
+ System.out.println("FileChooser Pfad: "+ini.get("main", "Letzter Downloadpfad", String.class));
+ fc.setCurrentDirectory(new File(ini.get("main", "Letzter Downloadpfad", String.class)));
+ } catch (InvalidFileFormatException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ } catch (IOException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ }
File dir = fc.getSelectedFile();
// check if directory is selected
if (dir != null) {
@@ -169,6 +187,20 @@ public class FTPEditDownloader_GUI extends JFrame implements
}
lblPath = new JLabel("");
+ try {
+ Wini ini = new Wini(
+ new File(
+ "C:\\Users\\"
+ + System.getProperty("user.name")
+ + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini"));
+ lblPath.setText(ini.get("main", "Letzter Downloadpfad",String.class));
+ } catch (InvalidFileFormatException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ } catch (IOException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ }
lblPath.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent arg0) {
if (lblPath.getText().isEmpty()) {
@@ -414,7 +446,21 @@ public class FTPEditDownloader_GUI extends JFrame implements
JOptionPane.ERROR_MESSAGE);
}
}
-
+ try {
+ Wini ini = new Wini(
+ new File(
+ "C:\\Users\\"
+ + System.getProperty("user.name")
+ + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini"));
+ ini.put("main", "Letzter Downloadpfad", lblPath.getText());
+ ini.store();
+ } catch (InvalidFileFormatException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ } catch (IOException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ }
SearchEditImage_GUI se = new SearchEditImage_GUI();
se.setVisible(true);
dispose();