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 final BusinessHandler getBusinessHandler()
public final FtpConfiguration getConfiguration()
public final FtpDir getDir()
getDir
in interface SessionInterface
public final FtpDataAsyncConn getDataConn()
public final FtpAuth getAuth()
getAuth
in interface SessionInterface
public final Restart getRestart()
getRestart
in interface SessionInterface
public final void setControlConnected()
public final void setSpecialInit(FtpAuth auth, FtpDir dir, Restart restart)
auth
- dir
- restart
- public final io.netty.channel.Channel getControlChannel()
public final NetworkHandler getNetworkHandler()
public final void setNextCommand(CommandInterface command)
command
- public final AbstractCommand getCurrentCommand()
public final AbstractCommand getPreviousCommand()
public final void setPreviousAsCurrentCommand()
public final boolean isCurrentCommandFinished()
public final void setCurrentCommandFinished()
public final String getAnswer()
public final void setReplyCode(ReplyCode replyCode, String answer)
replyCode
- the replyCode to setanswer
- public final void setReplyCode(CommandAbstractException exception)
exception
- public final void setExitErrorCode(String answer)
answer
- public final void setExitNormalCode(String answer)
answer
- public final ReplyCode getReplyCode()
public final void clear()
SessionInterface
clear
in interface SessionInterface
public final boolean isReady()
public final void setReady(boolean isReady)
isReady
- the isReady to setpublic final int getBlockSize()
getBlockSize
in interface SessionInterface
public final FileParameterInterface getFileParameter()
getFileParameter
in interface SessionInterface
public static String getBasename(String path)
path
- public final void reinitFtpAuth()
public final void rein()
public final void openDataConnection() throws Reply425Exception
Reply425Exception
- if the connection cannot be openedpublic final String getUniqueExtension()
getUniqueExtension
in interface SessionInterface
public final boolean isSsl()
public final void setSsl(boolean isSsl)
public void prepareSsl()
public final boolean isSslReady()
public final boolean isDataSsl()
public final void setDataSsl(boolean isDataSsl)
Copyright © 2009–2022 Waarp. All rights reserved.