public classFTPSEnvironmentextendsFTPEnvironment
FileSystemProvider.newFileSystem(URI, Map) andFileSystemProvider.newFileSystem(Path, Map) methods ofFTPSFileSystemProvider.FTPEnvironment.QueryParam,FTPEnvironment.QueryParams| Constructor and Description |
|---|
FTPSEnvironment()Creates a new FTPS environment. |
FTPSEnvironment(Map<String,Object> map)Creates a new FTPS environment. |
| Modifier and Type | Method and Description |
|---|---|
staticFTPSEnvironment | copy(Map<String,?> env)Copies a map to create a new FTPSEnvironment instance. |
static void | setDefault(FTPSEnvironment defaultEnvironment)Sets the default FTPS environment. |
FTPSEnvironment | withActiveExternalIPAddress(String ipAddress)Stores the external IP address in active mode. |
FTPSEnvironment | withActivePortRange(int minPort, int maxPort)Stores the client side port range in active mode. |
FTPSEnvironment | withAuthCommand(String command)Stores the AUTH command to use. |
FTPSEnvironment | withAutodetectEncoding(boolean autodetect)Stores whether or not automatic server encoding detection should be enabled. |
FTPSEnvironment | withBufferSize(int bufferSize)Stores the buffer size to use. |
FTPSEnvironment | withCharset(Charset charset)Stores the charset to use. |
FTPSEnvironment | withClientConfig(FTPClientConfig clientConfig)Stores the FTP client config to use. |
FTPSEnvironment | withConnectionMode(ConnectionMode connectionMode)Stores the connection mode to use. |
FTPSEnvironment | withConnectTimeout(int timeout)Stores the connection timeout to use. |
FTPSEnvironment | withControlEncoding(String encoding)Stores the character encoding to be used by the FTP control connection. |
FTPSEnvironment | withControlKeepAliveReplyTimeout(Duration timeout)Stores how long to wait for control keep-alive message replies. |
FTPSEnvironment | withControlKeepAliveReplyTimeout(int timeout)Deprecated. Use withControlKeepAliveReplyTimeout(Duration) instead. |
FTPSEnvironment | withControlKeepAliveTimeout(Duration timeout)Stores the time to wait between sending control connection keep-alive messages when processing file upload or download. |
FTPSEnvironment | withControlKeepAliveTimeout(long timeout)Deprecated. Use withControlKeepAliveTimeout(Duration) instead. |
FTPSEnvironment | withCredentials(String username, char[] password)Stores the credentials to use. |
FTPSEnvironment | withCredentials(String username, char[] password,String account)Stores the credentials to use. |
FTPSEnvironment | withDataChannelProtectionLevel(DataChannelProtectionLevel dataChannelProtectionLevel)Stores the data channel protection level to use. |
FTPSEnvironment | withDataTimeout(Duration timeout)Stores the timeout to use when reading from data connections. |
FTPSEnvironment | withDataTimeout(int timeout)Deprecated. Use withDataTimeout(Duration) instead. |
FTPSEnvironment | withDefaultDirectory(String pathname)Stores the default directory to use. |
FTPSEnvironment | withEnabledCipherSuites(String... cipherSuites)Stores the names of the cipher suites which could be enabled for use on connections. |
FTPSEnvironment | withEnabledProtocols(String... protocolVersions)Stores which particular protocol versions are enabled for use on connections. |
FTPSEnvironment | withEnabledSessionCreation(boolean established)Stores whether or not new SSL sessions may be established by sockets. |
FTPSEnvironment | withEndpointCheckingEnabled(boolean enabled)Stores whether or not endpoint identification using the HTTPS algorithm should be enabled. |
FTPSEnvironment | withFileSystemExceptionFactory(FileSystemExceptionFactory factory)Stores the file system exception factory to use. |
FTPSEnvironment | withFTPFileStrategyFactory(FTPFileStrategyFactory factory)Stores the FTP file strategy factory to use. |
FTPSEnvironment | withHostnameVerifier(HostnameVerifier hostnameVerifier)Stores the hostname verifier to use. |
FTPSEnvironment | withIpAddressFromPasvResponse(boolean usingIpAddressFromPasvResponse)Sets whether or not the IP address from the server's response should be used. |
FTPSEnvironment | withKeepAlive(boolean keepAlive)Stores whether or not SO_KEEPALIVE should be enabled. |
FTPSEnvironment | withKeyManager(KeyManager keyManager)Stores the key manager to use. |
FTPSEnvironment | withListHiddenFiles(boolean listHiddenFiles)Stores whether or not to list hidden files. |
FTPSEnvironment | withLocalAddress(InetAddress localAddr, int localPort)Stores the local address to use. |
FTPSEnvironment | withNeedClientAuth(boolean needClientAuth)Stores whether or not sockets will require client authentication. |
FTPSEnvironment | withParserFactory(FTPFileEntryParserFactory parserFactory)Stores the factory used for parser creation. |
FTPSEnvironment | withPassiveLocalIPAddress(String ipAddress)Stores the local IP address to use in passive mode. |
FTPSEnvironment | withPassiveNatWorkaroundStrategy(FTPClient.HostnameResolver resolver)Stores the workaround strategy to replace the PASV mode reply addresses. |
FTPSEnvironment | withPoolConfig(FTPPoolConfig poolConfig)Stores the pool config to use. |
FTPSEnvironment | withProtocol(String protocol)Stores the protocol to use. |
FTPSEnvironment | withProxy(Proxy proxy)Stores the proxy to use. |
FTPSEnvironment | withReceiveBufferSize(int size)Stores the socket receive buffer size to use. |
FTPSEnvironment | withReceiveDataSocketBufferSize(int bufferSize)Stores the value to use for the data socket SO_RCVBUF option. |
FTPSEnvironment | withRemoteVerificationEnabled(boolean enabled)Stores whether or not verification that the remote host taking part of a data connection is the same as the host to which the control connection is attached should be enabled. |
FTPSEnvironment | withReportActiveExternalIPAddress(String ipAddress)Stores the external IP address to report in EPRT/PORT commands in active mode. |
FTPSEnvironment | withSecurityMode(SecurityMode securityMode)Stores the security mode to use. |
FTPSEnvironment | withSendBufferSize(int size)Stores the socket send buffer size to use. |
FTPSEnvironment | withSendDataSocketBufferSize(int bufferSizr)Stores the value to use for the data socket SO_SNDBUF option. |
FTPSEnvironment | withServerSocketFactory(ServerSocketFactory factory)Stores the server socket factory to use. |
FTPSEnvironment | withSocketFactory(SocketFactory factory)Stores the socket factory to use. |
FTPSEnvironment | withSoLinger(boolean on, int linger)Stores whether or not SO_LINGER should be enabled, and if so, the linger time. |
FTPSEnvironment | withSoTimeout(int timeout)Stores the socket timeout. |
FTPSEnvironment | withSSLContext(SSLContext sslContext)Stores the SSL context to use. |
FTPSEnvironment | withStrictMultilineParsing(boolean strictMultilineParsing)Stores whether or not strict multiline parsing should be enabled, as per RFC 959, section 4.2. |
FTPSEnvironment | withTcpNoDelay(boolean on)Stores whether or not the Nagle's algorithm ( TCP_NODELAY) should be enabled. |
FTPSEnvironment | withTrustManager(TrustManager trustManager)Stores the trust manager to use. |
FTPSEnvironment | withUseClientMode(boolean useClientMode)Stores whether or not sockets are set to use client mode in their first handshake. |
FTPSEnvironment | withUseEPSVwithIPv4(boolean selected)Stores whether or not to use EPSV with IPv4. |
FTPSEnvironment | withWantClientAuth(boolean wantClientAuth)Stores whether or not sockets will request client authentication. |
clear,containsKey,containsValue,entrySet,equals,get,hashCode,isEmpty,keySet,put,putAll,remove,setDefault,size,toString,valuesclone,finalize,getClass,notify,notifyAll,wait,wait,waitcompute,computeIfAbsent,computeIfPresent,forEach,getOrDefault,merge,putIfAbsent,remove,replace,replace,replaceAllpublic FTPSEnvironment withLocalAddress(InetAddress localAddr, int localPort)
FTPEnvironmentwithLocalAddress in class FTPEnvironmentlocalAddr - The local address to use.localPort - The local port to use.Socket.bind(SocketAddress),InetSocketAddress(InetAddress, int)public FTPSEnvironment withCredentials(String username, char[] password)
FTPEnvironmentwithCredentials in class FTPEnvironmentusername - The username to use.password - The password to use.public FTPSEnvironment withCredentials(String username, char[] password,String account)
FTPEnvironmentwithCredentials in class FTPEnvironmentusername - The username to use.password - The password to use.account - The account to use.public FTPSEnvironment withSoTimeout(int timeout)
FTPEnvironmentwithSoTimeout in class FTPEnvironmenttimeout - The socket timeout in milliseconds.Socket.setSoTimeout(int)public FTPSEnvironment withSendBufferSize(int size)
FTPEnvironmentwithSendBufferSize in class FTPEnvironmentsize - The size of the buffer in bytes.Socket.setSendBufferSize(int)public FTPSEnvironment withReceiveBufferSize(int size)
FTPEnvironmentwithReceiveBufferSize in class FTPEnvironmentsize - The size of the buffer in bytes.Socket.setReceiveBufferSize(int)public FTPSEnvironment withTcpNoDelay(boolean on)
FTPEnvironmentTCP_NODELAY) should be enabled.withTcpNoDelay in class FTPEnvironmenton -true if Nagle's algorithm should be enabled, orfalse otherwise.Socket.setTcpNoDelay(boolean)public FTPSEnvironment withKeepAlive(boolean keepAlive)
FTPEnvironmentSO_KEEPALIVE should be enabled.withKeepAlive in class FTPEnvironmentkeepAlive -true if keep-alive should be enabled, orfalse otherwise.Socket.setKeepAlive(boolean)public FTPSEnvironment withSoLinger(boolean on, int linger)
FTPEnvironmentSO_LINGER should be enabled, and if so, the linger time.withSoLinger in class FTPEnvironmenton -true ifSO_LINGER should be enabled, orfalse otherwise.linger - The linger time in seconds, ifon istrue.Socket.setSoLinger(boolean, int)public FTPSEnvironment withSocketFactory(SocketFactory factory)
FTPEnvironmentwithSocketFactory in class FTPEnvironmentfactory - The socket factory to use.public FTPSEnvironment withServerSocketFactory(ServerSocketFactory factory)
FTPEnvironmentwithServerSocketFactory in class FTPEnvironmentfactory - The server socket factory to use.public FTPSEnvironment withConnectTimeout(int timeout)
FTPEnvironmentwithConnectTimeout in class FTPEnvironmenttimeout - The connection timeout in milliseconds.Socket.connect(SocketAddress, int)public FTPSEnvironment withProxy(Proxy proxy)
FTPEnvironmentwithProxy in class FTPEnvironmentproxy - The proxy to use.public FTPSEnvironment withCharset(Charset charset)
FTPEnvironmentwithCharset in class FTPEnvironmentcharset - The charset to use.public FTPSEnvironment withControlEncoding(String encoding)
FTPEnvironmentwithControlEncoding in class FTPEnvironmentencoding - The character encoding to use.public FTPSEnvironment withStrictMultilineParsing(boolean strictMultilineParsing)
withStrictMultilineParsing in class FTPEnvironmentstrictMultilineParsing -true to enable strict multiline parsing, orfalse to disable it.@Deprecatedpublic FTPSEnvironment withDataTimeout(int timeout)
withDataTimeout(Duration) instead.withDataTimeout in class FTPEnvironmenttimeout - The timeout in milliseconds that is used when opening data connection sockets.public FTPSEnvironment withDataTimeout(Duration timeout)
withDataTimeout in class FTPEnvironmenttimeout - The timeout in milliseconds that is used when opening data connection sockets.public FTPSEnvironment withParserFactory(FTPFileEntryParserFactory parserFactory)
FTPEnvironmentwithParserFactory in class FTPEnvironmentparserFactory - The factory object used to createFTPFileEntryParserspublic FTPSEnvironment withIpAddressFromPasvResponse(boolean usingIpAddressFromPasvResponse)
FTPClient.FTP_IP_ADDRESS_FROM_PASV_RESPONSE.withIpAddressFromPasvResponse in class FTPEnvironmentusingIpAddressFromPasvResponse -true if the IP address from the server's response should be used, orfalse to ignore that IP address.public FTPSEnvironment withRemoteVerificationEnabled(boolean enabled)
FTPEnvironmentwithRemoteVerificationEnabled in class FTPEnvironmentenabled -true to enable verification, orfalse to disable verification.public FTPSEnvironment withDefaultDirectory(String pathname)
FTPEnvironmentwithDefaultDirectory in class FTPEnvironmentpathname - The default directory to use.public FTPSEnvironment withConnectionMode(ConnectionMode connectionMode)
FTPEnvironmentConnectionMode.ACTIVE.withConnectionMode in class FTPEnvironmentconnectionMode - The connection mode to use.public FTPSEnvironment withActivePortRange(int minPort, int maxPort)
FTPEnvironmentwithActivePortRange in class FTPEnvironmentminPort - The lowest available port (inclusive).maxPort - The highest available port (inclusive).public FTPSEnvironment withActiveExternalIPAddress(String ipAddress)
FTPEnvironmentwithActiveExternalIPAddress in class FTPEnvironmentipAddress - The external IP address of this machine.public FTPSEnvironment withPassiveLocalIPAddress(String ipAddress)
FTPEnvironmentwithPassiveLocalIPAddress in class FTPEnvironmentipAddress - The local IP address of this machine.public FTPSEnvironment withReportActiveExternalIPAddress(String ipAddress)
FTPEnvironmentwithReportActiveExternalIPAddress in class FTPEnvironmentipAddress - The external IP address of this machine.public FTPSEnvironment withBufferSize(int bufferSize)
FTPEnvironmentwithBufferSize in class FTPEnvironmentbufferSize - The buffer size to use.public FTPSEnvironment withSendDataSocketBufferSize(int bufferSizr)
FTPEnvironmentSO_SNDBUF option.withSendDataSocketBufferSize in class FTPEnvironmentbufferSizr - The size of the buffer.public FTPSEnvironment withReceiveDataSocketBufferSize(int bufferSize)
FTPEnvironmentSO_RCVBUF option.withReceiveDataSocketBufferSize in class FTPEnvironmentbufferSize - The size of the buffer.public FTPSEnvironment withClientConfig(FTPClientConfig clientConfig)
FTPEnvironmentwithClientConfig in class FTPEnvironmentclientConfig - The client config to use.public FTPSEnvironment withUseEPSVwithIPv4(boolean selected)
FTPEnvironmentFor example, when using IPv4 with NAT it may work with some rare configurations. E.g. if FTP server has a static PASV address (external network) and the client is coming from another internal network. In that case the data connection after PASV command would fail, while EPSV would make the client succeed by taking just the port.
withUseEPSVwithIPv4 in class FTPEnvironmentselected - The flag to use.@Deprecatedpublic FTPSEnvironment withControlKeepAliveTimeout(long timeout)
withControlKeepAliveTimeout(Duration) instead.withControlKeepAliveTimeout in class FTPEnvironmenttimeout - The keep-alive timeout to use, in milliseconds.public FTPSEnvironment withControlKeepAliveTimeout(Duration timeout)
withControlKeepAliveTimeout in class FTPEnvironmenttimeout - The keep-alive timeout to use.@Deprecatedpublic FTPSEnvironment withControlKeepAliveReplyTimeout(int timeout)
withControlKeepAliveReplyTimeout(Duration) instead.withControlKeepAliveReplyTimeout in class FTPEnvironmenttimeout - The keep-alive reply timeout to use, in milliseconds.public FTPSEnvironment withControlKeepAliveReplyTimeout(Duration timeout)
withControlKeepAliveReplyTimeout in class FTPEnvironmenttimeout - The keep-alive reply timeout to use.public FTPSEnvironment withPassiveNatWorkaroundStrategy(FTPClient.HostnameResolver resolver)
FTPClient.NatServerResolverImpl, i.e. site-local replies are replaced.withPassiveNatWorkaroundStrategy in class FTPEnvironmentresolver - The workaround strategy to replace internal IP's in passive mode, ornull to disable the workaround (i.e. use PASV mode reply address.)public FTPSEnvironment withAutodetectEncoding(boolean autodetect)
FTPEnvironmentwithAutodetectEncoding in class FTPEnvironmentautodetect -true to enable automatic server encoding detection, orfalse to disable it.public FTPSEnvironment withListHiddenFiles(boolean listHiddenFiles)
true. Note that if this flag is set tofalse, the current directory will (most likely) not be returned when listing directories. That means thatStandardFTPFileStrategyFactory.UNIX will not work correctly.
Ideally, only set this flag (tofalse) if the FTP server does not support the-a option forLIST commands.
withListHiddenFiles in class FTPEnvironmentlistHiddenFiles -true to list hidden files, orfalse to omit them.public FTPSEnvironment withPoolConfig(FTPPoolConfig poolConfig)
Themaximum pool size influences the number of concurrent threads that can access an FTP file system.
If themaximum wait time isnegative, FTP file systems wait indefinitely until a client connection is available. This is the default setting if no pool config is defined.
withPoolConfig in class FTPEnvironmentpoolConfig - The pool config to use.public FTPSEnvironment withFileSystemExceptionFactory(FileSystemExceptionFactory factory)
FTPEnvironmentwithFileSystemExceptionFactory in class FTPEnvironmentfactory - The file system exception factory to use.public FTPSEnvironment withFTPFileStrategyFactory(FTPFileStrategyFactory factory)
FTPEnvironmentStandardFTPFileStrategyFactory.AUTO_DETECT.withFTPFileStrategyFactory in class FTPEnvironmentfactory - The FTP file strategy factory to use.@FTPEnvironment.QueryParam(value="securityMode")public FTPSEnvironment withSecurityMode(SecurityMode securityMode)
SecurityMode.EXPLICIT.securityMode - The security mode to use.public FTPSEnvironment withSSLContext(SSLContext sslContext)
protocol will be used instead.sslContext - The SSL context to use.@FTPEnvironment.QueryParam(value="protocol")public FTPSEnvironment withProtocol(String protocol)
TLS. The protocol will be ignored if anSSLContext is stored.protocol - The protocol to use.@FTPEnvironment.QueryParam(value="authCommand")public FTPSEnvironment withAuthCommand(String command)
command - The AUTH command to use.public FTPSEnvironment withKeyManager(KeyManager keyManager)
keyManager - The key manager to use.SSLContext.init(KeyManager[], TrustManager[], SecureRandom)public FTPSEnvironment withTrustManager(TrustManager trustManager)
trustManager - The trust manager to use.SSLContext.init(KeyManager[], TrustManager[], SecureRandom)public FTPSEnvironment withHostnameVerifier(HostnameVerifier hostnameVerifier)
client mode connections.hostnameVerifier - The hostname verifier to use.@FTPEnvironment.QueryParam(value="endpointCheckingEnabled")public FTPSEnvironment withEndpointCheckingEnabled(boolean enabled)
client mode connections.enabled -true if endpoint identification should be enabled, orfalse if it should be disabled.SSLSocket.setSSLParameters(SSLParameters),SSLParameters.setEndpointIdentificationAlgorithm(String)@FTPEnvironment.QueryParam(value="enabledSessionCreation")public FTPSEnvironment withEnabledSessionCreation(boolean established)
established - The established socket flag.SSLSocket.setEnableSessionCreation(boolean)@FTPEnvironment.QueryParam(value="needClientAuth")public FTPSEnvironment withNeedClientAuth(boolean needClientAuth)
needClientAuth - The need client authentication flag.SSLSocket.setNeedClientAuth(boolean)@FTPEnvironment.QueryParam(value="wantClientAuth")public FTPSEnvironment withWantClientAuth(boolean wantClientAuth)
wantClientAuth - The want client authentication flag.SSLSocket.setWantClientAuth(boolean)@FTPEnvironment.QueryParam(value="useClientMode")public FTPSEnvironment withUseClientMode(boolean useClientMode)
useClientMode - The use client mode flag.SSLSocket.setUseClientMode(boolean)@FTPEnvironment.QueryParam(value="enabledCipherSuites")public FTPSEnvironment withEnabledCipherSuites(String... cipherSuites)
cipherSuites - The names of the cipher suites to use.SSLSocket.setEnabledCipherSuites(String[])@FTPEnvironment.QueryParam(value="enabledProtocols")public FTPSEnvironment withEnabledProtocols(String... protocolVersions)
protocolVersions - The protocol versions to use.SSLSocket.setEnabledProtocols(String[])@FTPEnvironment.QueryParam(value="dataChannelProtectionLevel")public FTPSEnvironment withDataChannelProtectionLevel(DataChannelProtectionLevel dataChannelProtectionLevel)
dataChannelProtectionLevel - The data channel protection level to use.SSLSocket.setUseClientMode(boolean)public static FTPSEnvironment copy(Map<String,?> env)
FTPSEnvironment instance.env - The map to copy. It can be anFTPSEnvironment instance, but does not have to be.FTPSEnvironment instance that is a copy of the given map.public static void setDefault(FTPSEnvironment defaultEnvironment)
FTPFileSystemProvider.getPath(URI) when a file system needs to be created, since no environment can be passed. This way, certain settings likepool configuration can still be applied.defaultEnvironment - The default FTPS environment. Usenull to reset it to an empty environment.Copyright © 2016–2024. All rights reserved.