01: /*
02: * This program is free software; you can redistribute it and/or
03: * modify it under the terms of the GNU General Public License
04: * as published by the Free Software Foundation; either version 2
05: * of the License, or (at your option) any later version.
06: *
07: * This program is distributed in the hope that it will be useful,
08: * but WITHOUT ANY WARRANTY; without even the implied warranty of
09: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10: * GNU General Public License for more details.
11: *
12: * You should have received a copy of the GNU General Public License
13: * along with this program; if not, write to the Free Software
14: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15: */
16: package net.sf.jftp.net;
17:
18: import java.io.IOException;
19: import java.io.InputStream;
20: import java.util.Date;
21: import java.util.Vector;
22:
23: /**
24: * Interface for all connection types
25: */
26: public interface BasicConnection {
27: public boolean hasUploaded = false;
28:
29: public void sendRawCommand(String cmd);
30:
31: //public boolean login(String user, String pass);
32: public void disconnect();
33:
34: public boolean isConnected();
35:
36: public String getPWD();
37:
38: public boolean cdup();
39:
40: public boolean mkdir(String dirName);
41:
42: public void list() throws IOException;
43:
44: public boolean chdir(String p);
45:
46: public boolean chdirNoRefresh(String p);
47:
48: public String getLocalPath();
49:
50: public boolean setLocalPath(String newPath);
51:
52: public String[] sortLs();
53:
54: public String[] sortSize();
55:
56: public Date[] sortDates();
57:
58: public int[] getPermissions();
59:
60: public int handleDownload(String file);
61:
62: public int handleUpload(String file);
63:
64: public int download(String file);
65:
66: public int upload(String file);
67:
68: public int upload(String file, InputStream in);
69:
70: public InputStream getDownloadInputStream(String file);
71:
72: public int removeFileOrDir(String file);
73:
74: public void addConnectionListener(ConnectionListener listener);
75:
76: public void setConnectionListeners(Vector listeners);
77:
78: public boolean rename(String from, String to);
79: }
|