ip1.ex14
Class JFtpResponse

java.lang.Object
  |
  +--ip1.ex14.JFtpResponse

public class JFtpResponse
extends java.lang.Object

The JFtpResponse class represents an FTP protocol response. As defined by RFC 959, FTP consist of one or more lines of text each starting with a 3 digit code.

Version:
$Id: JFtpResponse.java,v 1.8 2003/10/16 14:17:59 sharky Exp $
See Also:
JFtpControl, RFC 959

Field Summary
(package private)  java.lang.String args
           
(package private)  int code
           
(package private)  java.lang.String msg
           
(package private)  int type
           
 
Constructor Summary
private JFtpResponse(int type, java.lang.String args)
          Private constructor for internal use.
  JFtpResponse(JFtpControl control, java.io.BufferedReader in)
          The constructor.
 
Method Summary
 java.net.InetSocketAddress getAddr()
          Extract the SocketAddress from the response.
static JFtpResponse ioFailure()
          Fake reply signaling an I/O error.
 boolean isAck()
          Is the response a positive acknowledgment ?
 boolean isIncomplete()
          Did we get an 'incomplete information' response?
 java.lang.String toString()
          Display some info about the type of error.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

code

int code

type

int type

msg

java.lang.String msg

args

java.lang.String args
Constructor Detail

JFtpResponse

private JFtpResponse(int type,
                     java.lang.String args)
Private constructor for internal use.


JFtpResponse

public JFtpResponse(JFtpControl control,
                    java.io.BufferedReader in)
             throws java.io.IOException
The constructor.

Parameters:
control - the JFtpControl we are operating in
in - the BufferedRead to read from
Method Detail

ioFailure

public static JFtpResponse ioFailure()
Fake reply signaling an I/O error.


isAck

public boolean isAck()
Is the response a positive acknowledgment ?


isIncomplete

public boolean isIncomplete()
Did we get an 'incomplete information' response?


toString

public java.lang.String toString()
Display some info about the type of error.

Overrides:
toString in class java.lang.Object

getAddr

public java.net.InetSocketAddress getAddr()
                                   throws java.net.UnknownHostException
Extract the SocketAddress from the response.

java.net.UnknownHostException
See Also:
JFtpData.JFtpData(ip1.ex14.JFtpControl)