1 |
/* |
/* |
2 |
* $Id$ |
* FTPResponse.java |
3 |
* Copyright (C) 2003 The Free Software Foundation |
* Copyright (C) 2003 The Free Software Foundation |
4 |
* |
* |
5 |
* This file is part of GNU inetlib, a library. |
* This file is part of GNU inetlib, a library. |
42 |
* An FTP control response. |
* An FTP control response. |
43 |
* |
* |
44 |
* @author <a href='mailto:dog@gnu.org'>Chris Burdess</a> |
* @author <a href='mailto:dog@gnu.org'>Chris Burdess</a> |
|
* @version $Revision$ $Date$ |
|
45 |
*/ |
*/ |
46 |
public final class FTPResponse |
public final class FTPResponse |
47 |
{ |
{ |
48 |
|
|
49 |
/** |
/** |
50 |
* The 3-digit status code. |
* The 3-digit status code. |
51 |
*/ |
*/ |
52 |
protected final int code; |
protected final int code; |
53 |
|
|
54 |
/** |
/** |
55 |
* The human-readable message. |
* The human-readable message. |
56 |
*/ |
*/ |
57 |
protected final String message; |
protected final String message; |
58 |
|
|
59 |
/** |
/** |
60 |
* Multiline data, if present. |
* Multiline data, if present. |
61 |
*/ |
*/ |
62 |
protected final String data; |
protected final String data; |
63 |
|
|
64 |
/** |
/** |
65 |
* Constructs a new FTP response. |
* Constructs a new FTP response. |
66 |
* @param code the status code |
* @param code the status code |
67 |
* @param message the message |
* @param message the message |
68 |
*/ |
*/ |
69 |
public FTPResponse(int code, String message) |
public FTPResponse(int code, String message) |
70 |
{ |
{ |
71 |
this(code, message, null); |
this(code, message, null); |
72 |
} |
} |
73 |
|
|
74 |
/** |
/** |
75 |
* Constructs a new multiline FTP response. |
* Constructs a new multiline FTP response. |
76 |
* @param code the status code |
* @param code the status code |
77 |
* @param message the message |
* @param message the message |
78 |
* @param data multiline data |
* @param data multiline data |
79 |
*/ |
*/ |
80 |
public FTPResponse(int code, String message, String data) |
public FTPResponse(int code, String message, String data) |
81 |
{ |
{ |
82 |
this.code = code; |
this.code = code; |
84 |
this.data = data; |
this.data = data; |
85 |
} |
} |
86 |
|
|
87 |
/** |
/** |
88 |
* Returns the 3-digit status code. |
* Returns the 3-digit status code. |
89 |
*/ |
*/ |
90 |
public int getCode() |
public int getCode() |
91 |
{ |
{ |
92 |
return code; |
return code; |
93 |
} |
} |
94 |
|
|
95 |
/** |
/** |
96 |
* Returns the human-readable message. |
* Returns the human-readable message. |
97 |
*/ |
*/ |
98 |
public String getMessage() |
public String getMessage() |
99 |
{ |
{ |
100 |
return message; |
return message; |
101 |
} |
} |
102 |
|
|
103 |
/** |
/** |
104 |
* Returns the multiline data, or null if there was no such data. |
* Returns the multiline data, or null if there was no such data. |
105 |
*/ |
*/ |
106 |
public String getData() |
public String getData() |
107 |
{ |
{ |
108 |
return data; |
return data; |
109 |
} |
} |
110 |
|
|
111 |
} |
} |
112 |
|
|