public class FtpSession extends Object implements SessionInterface
Constructor and Description |
---|
FtpSession(FtpConfiguration configuration,
BusinessHandler handler)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clean the session
|
String |
getAnswer() |
FtpAuth |
getAuth() |
static String |
getBasename(String path) |
int |
getBlockSize() |
BusinessHandler |
getBusinessHandler() |
FtpConfiguration |
getConfiguration()
Get the configuration
|
io.netty.channel.Channel |
getControlChannel() |
AbstractCommand |
getCurrentCommand() |
FtpDataAsyncConn |
getDataConn() |
FtpDir |
getDir() |
FileParameterInterface |
getFileParameter() |
NetworkHandler |
getNetworkHandler() |
AbstractCommand |
getPreviousCommand() |
ReplyCode |
getReplyCode() |
Restart |
getRestart() |
String |
getUniqueExtension() |
boolean |
isCurrentCommandFinished() |
boolean |
isDataSsl() |
boolean |
isReady() |
boolean |
isSsl() |
boolean |
isSslReady() |
void |
openDataConnection()
Try to open a connection.
|
void |
prepareSsl() |
void |
rein()
Reinitialize all connection parameters, including authentification
|
void |
reinitFtpAuth()
Reinitialize the authentication to the connection step
|
void |
setControlConnected()
This function is called when the Command Channel is connected (from
channelConnected of the NetworkHandler)
|
void |
setCurrentCommandFinished()
Set the Current Command as finished
|
void |
setDataSsl(boolean isDataSsl) |
void |
setExitErrorCode(String answer)
Set Exit code after an error
|
void |
setExitNormalCode(String answer)
Set Exit normal code
|
void |
setNextCommand(CommandInterface command)
Set the new current command
|
void |
setPreviousAsCurrentCommand()
Set the previous command as the new current command (used after a
incorrect
sequence of commands or unknown
command)
|
void |
setReady(boolean isReady) |
void |
setReplyCode(CommandAbstractException exception) |
void |
setReplyCode(ReplyCode replyCode,
String answer) |
void |
setSpecialInit(FtpAuth auth,
FtpDir dir,
Restart restart)
Special initialization (FtpExec with Https session)
|
void |
setSsl(boolean isSsl) |
String |
toString() |
public FtpSession(FtpConfiguration configuration, BusinessHandler handler)
configuration
- handler
- public BusinessHandler getBusinessHandler()
public FtpConfiguration getConfiguration()
public FtpDir getDir()
getDir
in interface SessionInterface
public FtpDataAsyncConn getDataConn()
public FtpAuth getAuth()
getAuth
in interface SessionInterface
public Restart getRestart()
getRestart
in interface SessionInterface
public void setControlConnected()
public void setSpecialInit(FtpAuth auth, FtpDir dir, Restart restart)
auth
- dir
- restart
- public io.netty.channel.Channel getControlChannel()
public NetworkHandler getNetworkHandler()
public void setNextCommand(CommandInterface command)
command
- public AbstractCommand getCurrentCommand()
public AbstractCommand getPreviousCommand()
public void setPreviousAsCurrentCommand()
public boolean isCurrentCommandFinished()
public void setCurrentCommandFinished()
public String getAnswer()
public void setReplyCode(ReplyCode replyCode, String answer)
replyCode
- the replyCode to setanswer
- public void setReplyCode(CommandAbstractException exception)
exception
- public void setExitErrorCode(String answer)
answer
- public void setExitNormalCode(String answer)
answer
- public ReplyCode getReplyCode()
public void clear()
SessionInterface
clear
in interface SessionInterface
public boolean isReady()
public void setReady(boolean isReady)
isReady
- the isReady to setpublic int getBlockSize()
getBlockSize
in interface SessionInterface
public FileParameterInterface getFileParameter()
getFileParameter
in interface SessionInterface
public static String getBasename(String path)
path
- public void reinitFtpAuth()
public void rein()
public void openDataConnection() throws Reply425Exception
Reply425Exception
- if the connection cannot be openedpublic String getUniqueExtension()
getUniqueExtension
in interface SessionInterface
public boolean isSsl()
public void setSsl(boolean isSsl)
public void prepareSsl()
public boolean isSslReady()
public boolean isDataSsl()
public void setDataSsl(boolean isDataSsl)
Copyright © 2009–2020 Waarp. All rights reserved.