Package com.enterprisedt.net.ftp
Class AdvancedGeneralSettings
java.lang.Object
com.enterprisedt.net.ftp.AdvancedGeneralSettings
Holds advanced configuration options that are independent of protocol (relevant
for any file transfer protocol, not just FTP). These options must be set prior
to establishing connections, otherwise they have no effect until a new connection
is made.
- Version:
- $Revision$
- Author:
- Bruce Blackshaw
-
Method Summary
Modifier and TypeMethodDescriptionGet the encoding used for the control channelbooleanDetermine if file locking on local downloaded files is being used or not.intGet the size of the data buffers used in reading and writing to the serverintGet the interval used for progress notification of transfers.booleanDetermine if auto login is switched onbooleanIf true, delete partially written files when exceptions are thrown during a downloadbooleanAre we listening on all interfaces in active mode, which is the default?voidsetAutoLogin(boolean autoLogin) Set the autoLogin flagvoidsetControlEncoding(String controlEncoding) Set the control channel encoding.voidsetDeleteOnFailure(boolean deleteOnFailure) Switch on or off the automatic deletion of partially written files that are left when an exception is thrown during a downloadvoidsetFileLockingEnabled(boolean lockingEnabled) Set file locking to enabled or disabled.voidsetListenOnAllInterfaces(boolean listenOnAll) Listen on all interfaces for active mode transfers (the default).voidsetTransferBufferSize(int size) Set the size of the data buffers used in reading and writing to the servervoidsetTransferNotifyInterval(int notifyInterval) Set the interval used for progress notification of transfers.
-
Method Details
-
isAutoLogin
public boolean isAutoLogin()Determine if auto login is switched on- Returns:
- true if auto login
-
setAutoLogin
public void setAutoLogin(boolean autoLogin) Set the autoLogin flag- Parameters:
autoLogin- true if logging in automatically
-
setListenOnAllInterfaces
public void setListenOnAllInterfaces(boolean listenOnAll) Listen on all interfaces for active mode transfers (the default).- Parameters:
listenOnAll- true if listen on all interfaces, false to listen on the control interface
-
isListenOnAllInterfaces
public boolean isListenOnAllInterfaces()Are we listening on all interfaces in active mode, which is the default?- Returns:
- true if listening on all interfaces, false if listening just on the control interface
-
isDeleteOnFailure
public boolean isDeleteOnFailure()If true, delete partially written files when exceptions are thrown during a download- Returns:
- true if delete local file on error
-
setDeleteOnFailure
public void setDeleteOnFailure(boolean deleteOnFailure) Switch on or off the automatic deletion of partially written files that are left when an exception is thrown during a download- Parameters:
deleteOnFailure- true if delete when a failure occurs
-
getControlEncoding
Get the encoding used for the control channel- Returns:
- Returns the current controlEncoding.
-
setControlEncoding
Set the control channel encoding.- Parameters:
controlEncoding- The controlEncoding to set, which is the name of a Charset
-
setTransferBufferSize
public void setTransferBufferSize(int size) Set the size of the data buffers used in reading and writing to the server- Parameters:
size- new size of buffer in bytes
-
getTransferBufferSize
public int getTransferBufferSize()Get the size of the data buffers used in reading and writing to the server- Returns:
- transfer buffer size
-
getTransferNotifyInterval
public int getTransferNotifyInterval()Get the interval used for progress notification of transfers.- Returns:
- number of bytes between each notification.
-
setTransferNotifyInterval
public void setTransferNotifyInterval(int notifyInterval) Set the interval used for progress notification of transfers.- Parameters:
notifyInterval- number of bytes between each notification
-
setFileLockingEnabled
public void setFileLockingEnabled(boolean lockingEnabled) Set file locking to enabled or disabled. When downloading files, by default the local file is locked for exclusive writing to prevent other processes corrupting it. Sometimes this needs to be disabled, e.g. tryLock() fails on NFS drives in versions of Java prior to 7.- Parameters:
lockingEnabled- true to enable locking, false to disable
-
getFileLockingEnabled
public boolean getFileLockingEnabled()Determine if file locking on local downloaded files is being used or not. Default is true.- Returns:
- true if file locking is enabled, false otherwise
-