Package com.consol.citrus.ftp.message
Class FtpMessage
- java.lang.Object
-
- com.consol.citrus.message.DefaultMessage
-
- com.consol.citrus.ftp.message.FtpMessage
-
- All Implemented Interfaces:
com.consol.citrus.message.Message,Serializable
public class FtpMessage extends com.consol.citrus.message.DefaultMessage- Since:
- 2.7.5
- Author:
- Christoph Deppisch
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FtpMessage(com.consol.citrus.message.Message message)Constructs copy of given message.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FtpMessagearguments(String arguments)Sets the command args.static FtpMessagecommand(org.apache.commons.net.ftp.FTPCmd command)Sets the ftp command.static FtpMessageconnect(String sessionId)Creates new connect command message.static FtpMessagedelete(String remotePath)Creates new delete command message.static FtpMessagedeleteResult(int replyCode, String replyString, boolean success)static FtpMessageerror()static FtpMessageerror(int replyCode)static FtpMessageerror(int replyCode, String replyString)static FtpMessageget(String remotePath)Creates new get command message.static FtpMessageget(String remotePath, String localPath, org.apache.ftpserver.ftplet.DataType type)Creates new get command message.static FtpMessageget(String remotePath, org.apache.ftpserver.ftplet.DataType type)Creates new get command message.StringgetArguments()Gets the command args.ObjectgetPayload()<T> TgetPayload(Class<T> type)IntegergetReplyCode()Gets the reply code.StringgetReplyString()Gets the reply string.StringgetSignal()Gets the ftp command signal.booleanhasException()Check if reply code is set on this message.booleanhasReplyCode()Check if reply code is set on this message.static FtpMessagelist(String remotePath)Creates new delete command message.static FtpMessageput(String localPath)Creates new put command message.static FtpMessageput(String localPath, String remotePath, org.apache.ftpserver.ftplet.DataType type)Creates new put command message.static FtpMessageput(String localPath, org.apache.ftpserver.ftplet.DataType type)Creates new put command message.static FtpMessageputResult(int replyCode, String replyString, boolean success)static FtpMessageresult(int replyCode, String replyString, boolean success)static FtpMessageresult(int replyCode, String replyString, String path, String content)static FtpMessageresult(int replyCode, String replyString, List<String> fileNames)static FtpMessageresult(CommandResultType commandResult)static FtpMessagesuccess()static FtpMessagesuccess(int replyCode)static FtpMessagesuccess(int replyCode, String replyString)-
Methods inherited from class com.consol.citrus.message.DefaultMessage
addHeaderData, getHeader, getHeaderData, getHeaders, getId, getName, getTimestamp, getType, removeHeader, setHeader, setName, setPayload, setType, setType, toString
-
-
-
-
Method Detail
-
command
public static FtpMessage command(org.apache.commons.net.ftp.FTPCmd command)
Sets the ftp command.- Parameters:
command-- Returns:
-
connect
public static FtpMessage connect(String sessionId)
Creates new connect command message.- Parameters:
sessionId-- Returns:
-
put
public static FtpMessage put(String localPath)
Creates new put command message.- Parameters:
localPath-- Returns:
-
put
public static FtpMessage put(String localPath, org.apache.ftpserver.ftplet.DataType type)
Creates new put command message.- Parameters:
localPath-type-- Returns:
-
put
public static FtpMessage put(String localPath, String remotePath, org.apache.ftpserver.ftplet.DataType type)
Creates new put command message.- Parameters:
localPath-remotePath-type-- Returns:
-
get
public static FtpMessage get(String remotePath)
Creates new get command message.- Parameters:
remotePath-- Returns:
-
get
public static FtpMessage get(String remotePath, org.apache.ftpserver.ftplet.DataType type)
Creates new get command message.- Parameters:
remotePath-type-- Returns:
-
get
public static FtpMessage get(String remotePath, String localPath, org.apache.ftpserver.ftplet.DataType type)
Creates new get command message.- Parameters:
remotePath-localPath-type-- Returns:
-
delete
public static FtpMessage delete(String remotePath)
Creates new delete command message.- Parameters:
remotePath-- Returns:
-
list
public static FtpMessage list(String remotePath)
Creates new delete command message.- Parameters:
remotePath-- Returns:
-
success
public static FtpMessage success()
-
success
public static FtpMessage success(int replyCode)
-
success
public static FtpMessage success(int replyCode, String replyString)
-
error
public static FtpMessage error()
-
error
public static FtpMessage error(int replyCode)
-
error
public static FtpMessage error(int replyCode, String replyString)
-
result
public static FtpMessage result(int replyCode, String replyString, boolean success)
-
deleteResult
public static FtpMessage deleteResult(int replyCode, String replyString, boolean success)
-
putResult
public static FtpMessage putResult(int replyCode, String replyString, boolean success)
-
result
public static FtpMessage result(CommandResultType commandResult)
-
result
public static FtpMessage result(int replyCode, String replyString, List<String> fileNames)
-
result
public static FtpMessage result(int replyCode, String replyString, String path, String content)
-
arguments
public FtpMessage arguments(String arguments)
Sets the command args.- Parameters:
arguments-
-
getSignal
public String getSignal()
Gets the ftp command signal.
-
getArguments
public String getArguments()
Gets the command args.
-
getReplyCode
public Integer getReplyCode()
Gets the reply code.
-
hasReplyCode
public boolean hasReplyCode()
Check if reply code is set on this message.- Returns:
-
hasException
public boolean hasException()
Check if reply code is set on this message.- Returns:
-
getReplyString
public String getReplyString()
Gets the reply string.
-
getPayload
public <T> T getPayload(Class<T> type)
- Specified by:
getPayloadin interfacecom.consol.citrus.message.Message- Overrides:
getPayloadin classcom.consol.citrus.message.DefaultMessage
-
getPayload
public Object getPayload()
- Specified by:
getPayloadin interfacecom.consol.citrus.message.Message- Overrides:
getPayloadin classcom.consol.citrus.message.DefaultMessage
-
-