KickJava   Java API By Example, From Geeks To Geeks.

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


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
19 /**
20 * This class provides some constant used by FtpConnection.
21 */

22 public interface FtpConstants
23 {
24     /** List */
25
26     //public static final String LIST = "LIST -laL";
27

28     /** Possible upload() / download() return code */
29     public static final int TRANSFER_FAILED = -1;
30
31     /** Possible upload() / download() return code */
32     public static final int TRANSFER_STOPPED = -2;
33
34     /** Possible upload() / download() / remove() return code */
35     public static final int MKDIR_FAILED = -3;
36
37     /** Possible upload() / download() return code */
38     public static final int PERMISSION_DENIED = -4;
39
40     /** Possible upload() / download() / exists() return code */
41     public static final int CHDIR_FAILED = -5;
42
43     /** Possible login() return code */
44     public final static int WRONG_LOGIN_DATA = -6;
45
46     /** Possible login() return code */
47     public final static int OFFLINE = -7;
48
49     /** Possible login() / remove() return code */
50     public final static int GENERIC_FAILED = -8;
51
52     /** Possible remove() return code */
53     public final static int REMOVE_FAILED = -9;
54
55     /** Possible upload() return code */
56     public final static int RENAME_FAILED = -10;
57
58     /** Possible exists() return code */
59     public final static int FILE_NOT_FOUND = -11;
60
61     /** Possible up/download() return code */
62     public final static int DATACONNECTION_FAILED = -12;
63
64     /** Possible upload() / download() return code */
65     public static final int NEW_TRANSFER_SPAWNED = 0;
66
67     /** Possible upload() / download() return code */
68     public static final int TRANSFER_SUCCESSFUL = 1;
69
70     /** Possible login() return code */
71     public final static int LOGIN_OK = 2;
72
73     /** Possible remove() return code */
74     public final static int REMOVE_SUCCESSFUL = 3;
75
76     /** Possible getPermissions() / exists() return code */
77     public static final int R = 23;
78
79     /** Possible getPermissions() / exists() return code */
80     public static final int W = 42;
81
82     /** Possible getPermissions() / exists() return code */
83     public static final int DENIED = -666;
84
85     // Access Control Commands
86

87     /** User Name */
88     public final static String JavaDoc USER = "USER";
89
90     /** Password */
91     public final static String JavaDoc PASS = "PASS";
92
93     /** Account */
94     public final static String JavaDoc ACCT = "ACCT";
95
96     /** Change Working Directory */
97     public final static String JavaDoc CWD = "CWD";
98
99     /** Change to Parent Directory */
100     public final static String JavaDoc CDUP = "CDUP";
101
102     /** Structure Mount */
103     public final static String JavaDoc SMNT = "SMNT";
104
105     /** Reinitialize */
106     public final static String JavaDoc REIN = "REIN";
107
108     /** Logout */
109     public final static String JavaDoc QUIT = "QUIT";
110
111     // Transfer Parameter Commands
112

113     /** Data Port */
114     public final static String JavaDoc PORT = "PORT";
115
116     /** Passive */
117     public final static String JavaDoc PASV = "PASV";
118
119     /** Representation Type (ASCII, EBCDIC, Image, Non-print, Telnet format effectors, Carriage Control, Local byte Byte size) */
120     public final static String JavaDoc TYPE = "TYPE";
121
122     /** File Structure (File, Record Structure, Page Structure) */
123     public final static String JavaDoc STRU = "STRU";
124
125     /** Transfer Mode (Stream, Block, Compressed) */
126     public final static String JavaDoc MODE = "MODE";
127
128     // FTP Service Commands
129

130     /** Retrieve */
131     public final static String JavaDoc RETR = "RETR";
132
133     /** Store */
134     public final static String JavaDoc STOR = "STOR";
135
136     /** Store Unique */
137     public final static String JavaDoc STOU = "STOU";
138
139     /** Append (with create) */
140     public final static String JavaDoc APPE = "APPE";
141
142     /** Allocate */
143     public final static String JavaDoc ALLO = "ALLO";
144
145     /** Restart */
146     public final static String JavaDoc REST = "REST";
147
148     /** Rename From */
149     public final static String JavaDoc RNFR = "RNFR";
150
151     /** Rename To */
152     public final static String JavaDoc RNTO = "RNTO";
153
154     /** Abort */
155     public final static String JavaDoc ABOR = "ABOR";
156
157     /** Delete */
158     public final static String JavaDoc DELE = "DELE";
159
160     /** Remove Directory */
161     public final static String JavaDoc RMD = "RMD";
162
163     /** Make Directory */
164     public final static String JavaDoc MKD = "MKD";
165
166     /** Print Working Directory */
167     public final static String JavaDoc PWD = "PWD";
168
169     /** Name List */
170     public final static String JavaDoc NLST = "NLST";
171
172     /** Site Parameters */
173     public final static String JavaDoc SITE = "SITE";
174
175     /** System */
176     public final static String JavaDoc SYST = "SYST";
177
178     /** Status */
179     public final static String JavaDoc STAT = "STAT";
180
181     /** Help */
182     public final static String JavaDoc HELP = "HELP";
183
184     /** NOOP */
185     public final static String JavaDoc NOOP = "NOOP";
186
187     // The following commands were introduced in rfc 2228 FTP Security Extensions
188

189     /** Authentication/Security Mechanism */
190     public final static String JavaDoc AUTH = "AUTH";
191
192     /** Authentication/Security Data */
193     public final static String JavaDoc ADAT = "ADAT";
194
195     /** Data Channel Protection Level */
196     public final static String JavaDoc PROT = "PROT";
197
198     /** Protection Buffer Size */
199     public final static String JavaDoc PBSZ = "PBSZ";
200
201     /** Clear Command Channel */
202     public final static String JavaDoc CCC = "CCC";
203
204     /** Integrity Protected Command */
205     public final static String JavaDoc MIC = "MIC";
206
207     /** Confidentiality Protected Command */
208     public final static String JavaDoc CONF = "CONF";
209
210     /** Privacy Protected Command */
211     public final static String JavaDoc ENC = "ENC";
212
213     // end of commands from rfc 2228
214
// ftp reply codes
215
// x0z Syntax
216
// x1z Information
217
// x2z Connections
218
// x3z Authentication and accounting
219
// x4z Unspecified
220
// x5z File system
221
// 1yz Positive Preliminary reply
222

223     /** Restart marker reply */
224     public final static String JavaDoc RC110 = "110";
225
226     /** Service ready in nnn minutes */
227     public final static String JavaDoc RC120 = "120";
228
229     /** Data connection already open */
230     public final static String JavaDoc RC125 = "125";
231
232     /** File status okay; about to open data connection */
233     public final static String JavaDoc RC150 = "150";
234
235     // 2yz Positive Completion reply
236

237     /** Command okay */
238     public final static String JavaDoc FTP200_OK = "2";
239
240     /** Command not implemented, superfluous at this site */
241     public final static String JavaDoc RC202 = "202";
242
243     /** System status, or system help reply */
244     public final static String JavaDoc RC211 = "211";
245
246     /** Directory status */
247     public final static String JavaDoc RC212 = "212";
248
249     /** File status */
250     public final static String JavaDoc RC213 = "213";
251
252     /** Help message */
253     public final static String JavaDoc RC214 = "214";
254
255     /** System type */
256     public final static String JavaDoc FTP215_SYSTEM_TYPE = "215";
257
258     /** Service ready for new user */
259     public final static String JavaDoc FTP220_SERVICE_READY = "220";
260
261     /** Service closing control connection */
262     public final static String JavaDoc FTP221_SERVICE_CLOSING = "221";
263
264     /** Data connection open; no transfer in progress */
265     public final static String JavaDoc RC225 = "225";
266
267     /** Closing data connection; requested file action successful */
268     public final static String JavaDoc FTP226_CLOSING_DATA_REQUEST_SUCCESSFUL = "226";
269
270     /** Entering Passive Mode */
271     public final static String JavaDoc FTP227_ENTERING_PASSIVE_MODE = "227";
272
273     /** User logged in, proceed */
274     public final static String JavaDoc FTP230_LOGGED_IN = "2"; // 230
275

276     /** Requested file action okay, completed */
277     public final static String JavaDoc FTP250_COMPLETED = "250";
278
279     /** "PATHNAME" created */
280     public final static String JavaDoc FTP257_PATH_CREATED = "257";
281
282     // 3yz Positive Intermediate reply
283

284     /** User name okay, need password */
285     public final static String JavaDoc FTP331_USER_OK_NEED_PASSWORD = "331";
286
287     /** Need account for login */
288     public final static String JavaDoc RC332 = "332";
289
290     /** Requested file action pending further information */
291     public final static String JavaDoc RC350 = "350";
292
293     // 4yz Transient Negative Completion reply
294

295     /** Service not available */
296     public final static String JavaDoc RC421 = "421";
297
298     /** Can't open data connection */
299     public final static String JavaDoc RC425 = "425";
300
301     /** Connection closed; transfer aborted */
302     public final static String JavaDoc RC426 = "426";
303
304     /** Requested file action not taken, file unavailable (file busy) */
305     public final static String JavaDoc RC450 = "450";
306
307     /** Requested action aborted: local error in processing */
308     public final static String JavaDoc RC451 = "451";
309
310     /** Requested action not taken, insufficient storage space in system */
311     public final static String JavaDoc RC452 = "452";
312
313     // 5yz Permanent Negative Completion reply
314

315     /** Syntax error, command unrecognized */
316     public final static String JavaDoc RC500 = "500";
317
318     /** Syntax error in parameters or arguments */
319     public final static String JavaDoc RC501 = "501";
320
321     /** Command not implemented */
322     public final static String JavaDoc RC502 = "502";
323
324     /** Bad sequence of commands */
325     public final static String JavaDoc RC503 = "503";
326
327     /** Command not implemented for that parameter */
328     public final static String JavaDoc RC504 = "504";
329
330     /** Not logged in */
331     public final static String JavaDoc RC530 = "530";
332
333     /** Need account for storing files */
334     public final static String JavaDoc RC532 = "532";
335
336     /** Requested action not taken, file unavailable (file not found, no access) */
337     public final static String JavaDoc RC550 = "550";
338
339     /** Requested action aborted: page type unknown */
340     public final static String JavaDoc RC551 = "551";
341
342     /** Requested file action aborted, exceeded storage allocation */
343     public final static String JavaDoc RC552 = "552";
344
345     /** Requested action not taken, file name not allowed */
346     public final static String JavaDoc RC553 = "553";
347 }
348
Popular Tags