com.glub.secureftp.bean
Class SSLFTPCommand

java.lang.Object
  extended by com.glub.secureftp.bean.FTPCommand
      extended by com.glub.secureftp.bean.SSLFTPCommand

public class SSLFTPCommand
extends FTPCommand

The SSLFTPCommand class is responsible for handling the SSL command extensions used in the File Transfer Protocol.

Since:
2.5
Version:
$Revision: 47 $, $Date: 2009-05-16 10:10:12 -0700 (Sat, 16 May 2009) $

Field Summary
static char CLEAR_DATA_CHANNEL
          Used to set the PROT mode to clear.
static char CONFIDENTIAL_DATA_CHANNEL
          Used to set the PROT mode to confidential.
static char PRIVATE_DATA_CHANNEL
          Used to set the PROT mode to private.
static char SAFE_DATA_CHANNEL
          Used to set the PROT mode to safe.
 
Constructor Summary
SSLFTPCommand(BufferedReader reader, PrintWriter writer)
          Create a new SSLFTPCommand object.
SSLFTPCommand(BufferedReader reader, PrintWriter writer, OutputStream sendCmdStream, OutputStream recvCmdStream)
          Create a new SSLFTPCommand object.
 
Method Summary
 void auth(String authType)
          Specify the authorization type.
 void ccc()
          Convert the control socket back to a clear control socket.
 void pbsz(int bufferSize)
          Specify the protection buffer.
 void prot(char securityMode)
          Specify the protection mode.
 
Methods inherited from class com.glub.secureftp.bean.FTPCommand
abort, acct, append, cdup, chdir, delete, forcePasvToUseControlIP, getReply, getReplyCode, getReplyMessage, help, list, mdtm, mkdir, modeZ, nlst, noop, pass, pasv, port, pwd, quit, raw, recvCmd, rename, rest, retrieve, rmdir, sendCmd, sendCmd, setControlIP, setRecvCmdStream, setSendCmdStream, size, store, syst, type, user
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PRIVATE_DATA_CHANNEL

public static final char PRIVATE_DATA_CHANNEL
Used to set the PROT mode to private.

See Also:
Constant Field Values

CLEAR_DATA_CHANNEL

public static final char CLEAR_DATA_CHANNEL
Used to set the PROT mode to clear.

See Also:
Constant Field Values

SAFE_DATA_CHANNEL

public static final char SAFE_DATA_CHANNEL
Used to set the PROT mode to safe.

See Also:
Constant Field Values

CONFIDENTIAL_DATA_CHANNEL

public static final char CONFIDENTIAL_DATA_CHANNEL
Used to set the PROT mode to confidential.

See Also:
Constant Field Values
Constructor Detail

SSLFTPCommand

public SSLFTPCommand(BufferedReader reader,
                     PrintWriter writer)
Create a new SSLFTPCommand object.

Parameters:
reader - based on the input stream from the control socket.
writer - based on the output stream from the control socket.

SSLFTPCommand

public SSLFTPCommand(BufferedReader reader,
                     PrintWriter writer,
                     OutputStream sendCmdStream,
                     OutputStream recvCmdStream)
Create a new SSLFTPCommand object.

Parameters:
reader - based on the input stream from the control socket.
writer - based on the output stream from the control socket.
sendCmdStream - stream used to report commands set to the FTP server.
recvCmdStream - stream used to report commands received from the FTP server.
Method Detail

auth

public void auth(String authType)
          throws FTPAuthNotSupportedException,
                 FTPException,
                 IllegalArgumentException
Specify the authorization type. This is used during the initialization of an explicit SSL connection.

Parameters:
authType - the auth type to send (e.g. SSL, TLS, etc.)
Throws:
FTPAuthNotSupportedException - if the server doesn't support this auth mode (or the auth command).
FTPException - if the FTP server returns an error code.
IllegalArgumentException - if authType is missing.

pbsz

public void pbsz(int bufferSize)
          throws FTPException
Specify the protection buffer. This must be called prior to the PROT command.

Parameters:
bufferSize - the size to pad the protection buffer (usually 0).
Throws:
FTPException - if the FTP server returns an error code.
See Also:
prot(char)

prot

public void prot(char securityMode)
          throws FTPException
Specify the protection mode. This must be called after the PBSZ command is sent.

Parameters:
securityMode - the security mode to set the data channel to.
Throws:
FTPException - if the FTP server returns an error code.
See Also:
PRIVATE_DATA_CHANNEL, CLEAR_DATA_CHANNEL, SAFE_DATA_CHANNEL, CONFIDENTIAL_DATA_CHANNEL, pbsz(int)

ccc

public void ccc()
         throws FTPException
Convert the control socket back to a clear control socket.

Throws:
FTPException - if the FTP server returns an error code.


Copyright © 2000-12 Glub Tech, Inc. All Rights Reserved.