org.finj
Interface FTPServerProfile

All Known Implementing Classes:
StrictFTPServerProfile

public interface FTPServerProfile

The goal of this interface is to leave the possibility to handle servers that do not comply with the RFC959 strictly. Custom implementations of this interface will allow developpers to handle such non-conforming servers transparently.

Copyright (C) 2000-2008 Javier Iglesias.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Version:
$Id: FTPServerProfile.java 47 2008-01-11 23:09:46Z jiglesias $
Author:
Javier Iglesias -- jiglesias@users.sourceforge.net

Method Summary
 boolean isCommandCompleted(FTPCommand command, FTPResponse response)
          Checks if the response is the last that one has to expect for the command.
 boolean isControlConnectionReady(FTPResponse response)
          Checks if the response is the last that one has to expect after establishing the control connection with a server.
 boolean isPostCommandCompleted(FTPCommand command, FTPResponse response)
          Checks if the response is the last that one has to expect to end a command that required a data connection setup and destruction.
 

Method Detail

isControlConnectionReady

boolean isControlConnectionReady(FTPResponse response)
                                 throws FTPException
Checks if the response is the last that one has to expect after establishing the control connection with a server.

Parameters:
response -
Returns:
true if the response is the last to expect from server when establishing the control connection.
Throws:
FTPException - response is not a valid response when establishing a control connection.
Since:
v1.2

isCommandCompleted

boolean isCommandCompleted(FTPCommand command,
                           FTPResponse response)
                           throws FTPException
Checks if the response is the last that one has to expect for the command.

Parameters:
command - org.finj.FTPCommand sent to the server.
response - org.finj.FTPResponse returned by the server.
Returns:
true if the response is the last to expect from server for the command.
Throws:
FTPException - response is not a valid answer for the command.
Since:
v1.0

isPostCommandCompleted

boolean isPostCommandCompleted(FTPCommand command,
                               FTPResponse response)
                               throws FTPException
Checks if the response is the last that one has to expect to end a command that required a data connection setup and destruction. This method only applies to: and should be called AFTER a call to isCommandCompleted(org.finj.FTPCommand, org.finj.FTPResponse) which will be the one triggering the command execution and data connection opening.

Parameters:
command - org.finj.FTPCommand sent to the server.
response - org.finj.FTPResponse returned by the server.
Returns:
true if the response is the last to expect from server for the command.
Throws:
FTPException - response is not a valid answer for the command.
Since:
v1.0


Copyright © 2009. All Rights Reserved.