|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.Prominic.jFTPd.FTPConnection.ConnectionState
class FTPConnection.ConnectionState
This class represents the current state of the connection - whether the control connection is secured or not - whether the data connection is secured or not It embeds the socket and also handles the communication with the server because it knows to use a SSL or a plain text socket.
Field Summary | |
---|---|
private boolean |
ccPlainText
|
private boolean |
dataPlainText
|
private java.net.Socket |
dataSock
|
private boolean |
hasPbsz
|
private java.io.BufferedReader |
in
|
private CRLFPrintWriter |
out
|
private int |
protectionBufferSize
|
private java.net.Socket |
sock
|
private javax.net.ssl.SSLSocket |
sslDataSock
|
private javax.net.ssl.SSLSocket |
sslsock
|
private boolean |
useProtectedDC
|
Constructor Summary | |
---|---|
FTPConnection.ConnectionState(java.net.Socket plaintext)
Initialises the state using a plain text socket. |
Method Summary | |
---|---|
void |
closeSockets()
Closes the sockets streams and then the sockets. |
void |
downgradeCCtoPlainText()
Closes the SSL layer on top of the command channel but keeps the CC channel in clear mode. |
java.io.BufferedReader |
getCCInputBuffer()
Returns the input buffer for the control connection |
CRLFPrintWriter |
getCCOutputBuffer()
Returns the output buffer for the control connection |
java.net.Socket |
getClientSocket()
Returns a data connection socket, SSL if needed. |
java.net.Socket |
getCurrentSocket()
Gets the current active socket (either SSL or not) |
java.io.InputStream |
getDataInputStream()
Gets the data input stream, either SSL or not. |
java.io.OutputStream |
getDataOutputStream()
Gets the data output stream, either SSL or not. |
boolean |
hasIssuedPBSZ()
Check if a protection buffer size has been set to something 0 or greater; |
void |
init()
Initialises the internal state. |
boolean |
isCCPlainText()
Returns true if the control connection is plain text |
boolean |
isCCSecure()
Returns whether the current control connection is secured. |
void |
sendReply(java.lang.String message)
Sends a reply to the client, using the current output stream (either SSL or not) |
void |
setProtectionBuffer(int size)
Sets the protection buffer to the given size. |
void |
setProtectionLevel(java.lang.String level)
Sets the protection level of the communication channel. |
boolean |
upgradeCCToSSL()
Upgrades the control connection to use SSL. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.net.Socket sock
private java.net.Socket dataSock
private javax.net.ssl.SSLSocket sslsock
private javax.net.ssl.SSLSocket sslDataSock
private boolean ccPlainText
private boolean dataPlainText
private CRLFPrintWriter out
private java.io.BufferedReader in
private int protectionBufferSize
private boolean useProtectedDC
private boolean hasPbsz
Constructor Detail |
---|
FTPConnection.ConnectionState(java.net.Socket plaintext)
plaintext
- Method Detail |
---|
public void init() throws java.io.IOException
java.io.IOException
- - when there's an error with the sockets.public boolean isCCSecure()
public boolean isCCPlainText()
public CRLFPrintWriter getCCOutputBuffer()
public java.io.BufferedReader getCCInputBuffer()
public boolean upgradeCCToSSL()
public void downgradeCCtoPlainText()
public void closeSockets() throws java.io.IOException
java.io.IOException
- - if something goes bad.public java.net.Socket getCurrentSocket()
public void sendReply(java.lang.String message)
message
- public void setProtectionBuffer(int size)
size
- = new size for protection buffer.public boolean hasIssuedPBSZ()
public void setProtectionLevel(java.lang.String level)
level
- - "P" for protection or "C" for clear.public java.net.Socket getClientSocket()
public java.io.OutputStream getDataOutputStream() throws java.io.IOException
java.io.IOException
public java.io.InputStream getDataInputStream() throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |