diff options
| author | tspitzer | 2013-09-30 09:17:29 +0200 |
|---|---|---|
| committer | tspitzer | 2013-09-30 09:17:29 +0200 |
| commit | 1d1153c6262f0ec69a7f29c92ba2c389f37e7c83 (patch) | |
| tree | 1d0a745266b8769db1e70ee17caa0c338c3effbc /Dozentenmodul/src/ftp/ftp.java | |
| parent | Erste Version fast fertig (diff) | |
| download | tutor-module-1d1153c6262f0ec69a7f29c92ba2c389f37e7c83.tar.gz tutor-module-1d1153c6262f0ec69a7f29c92ba2c389f37e7c83.tar.xz tutor-module-1d1153c6262f0ec69a7f29c92ba2c389f37e7c83.zip | |
actual
Diffstat (limited to 'Dozentenmodul/src/ftp/ftp.java')
| -rw-r--r-- | Dozentenmodul/src/ftp/ftp.java | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/Dozentenmodul/src/ftp/ftp.java b/Dozentenmodul/src/ftp/ftp.java deleted file mode 100644 index e128c1d0..00000000 --- a/Dozentenmodul/src/ftp/ftp.java +++ /dev/null @@ -1,101 +0,0 @@ -package ftp;
-
-
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.SocketException;
-import org.apache.commons.net.ftp.FTPClient;
-import org.apache.commons.net.ftp.FTPFile;
-
-public class ftp {
-
- /**
- * @param args
- */
- public String[] getAllRohling(String SearchString) throws SocketException
- {
- FTPClient ftp=new FTPClient();
- String[] filenamelist;
-
- try {
- ftp.connect("141.79.128.103", 21);
- ftp.login("ftpsecure", "ftp4openslx");
- ftp.changeWorkingDirectory("_vorlagen");
-
- filenamelist=ftp.listNames();
- String[] search=new String[filenamelist.length];
- for(int i=0;i<filenamelist.length;i++)
- {
- if(filenamelist[i].startsWith(SearchString)==true)
- {
- search[i]=filenamelist[i];
- }
- }
- return search;
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
-
-
- return null;
- }
-
- public boolean getFile(String name, String location){
- FTPClient ftp=new FTPClient();
-
-
- try {
- ftp.connect("openslx-nfs.rz.hs-offenburg.de", 21);
- ftp.login("tspitzer", "21071989");
- ftp.changeWorkingDirectory("_vorlagen");
- FileOutputStream os=new FileOutputStream(location+"\\"+name);
-
- System.out.println("Start");
- System.out.println(location+name);
-
- ftp.retrieveFile(name, os);
- System.out.println("Ende");
-
-
-
-
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
-
-
- return false;
- }
-
-
- public long getFileSize(String name){
- FTPClient ftp=new FTPClient();
-
-
- try {
- ftp.connect("openslx-nfs.rz.hs-offenburg.de", 21);
- ftp.login("tspitzer", "21071989");
- ftp.changeWorkingDirectory("_vorlagen");
- FTPFile[] file=new FTPFile[2];
- file=ftp.listFiles(name);
- System.out.println(file[0].getSize());
- return file[0].getSize();
-
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
-
-
- return 0;
- }
-
-
-
-
-}
|
