KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > jftp > net > BasicConnection


1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * 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 JavaDoc;
19 import java.io.InputStream JavaDoc;
20 import java.util.Date JavaDoc;
21 import java.util.Vector JavaDoc;
22
23
24 /**
25  * Interface for all connection types
26  */

27 public interface BasicConnection
28 {
29     public boolean hasUploaded = false;
30
31     public void sendRawCommand(String JavaDoc cmd);
32
33     //public boolean login(String user, String pass);
34
public void disconnect();
35
36     public boolean isConnected();
37
38     public String JavaDoc getPWD();
39
40     public boolean cdup();
41
42     public boolean mkdir(String JavaDoc dirName);
43
44     public void list() throws IOException JavaDoc;
45
46     public boolean chdir(String JavaDoc p);
47
48     public boolean chdirNoRefresh(String JavaDoc p);
49
50     public String JavaDoc getLocalPath();
51
52     public boolean setLocalPath(String JavaDoc newPath);
53
54     public String JavaDoc[] sortLs();
55
56     public String JavaDoc[] sortSize();
57
58     public Date JavaDoc[] sortDates();
59
60     public int[] getPermissions();
61
62     public int handleDownload(String JavaDoc file);
63
64     public int handleUpload(String JavaDoc file);
65
66     public int download(String JavaDoc file);
67
68     public int upload(String JavaDoc file);
69
70     public int upload(String JavaDoc file, InputStream JavaDoc in);
71
72     public InputStream JavaDoc getDownloadInputStream(String JavaDoc file);
73
74     public int removeFileOrDir(String JavaDoc file);
75
76     public void addConnectionListener(ConnectionListener listener);
77
78     public void setConnectionListeners(Vector JavaDoc listeners);
79
80     public boolean rename(String JavaDoc from, String JavaDoc to);
81 }
82
Popular Tags