_HOT_ Download Error Caught Java.net.unknownhostexception Repo1.maven.org

0 views
Skip to first unread message

Luana Clermont

unread,
Jan 20, 2024, 7:37:18 AM1/20/24
to limomeadva

Immediately after connecting is the only real time you need to check the reply code (because connect is of type void). The convention for all the FTP command methods in FTPClient is such that they either return a boolean value or some other value. The boolean methods return true on a successful completion reply from the FTP server and false on a reply resulting in an error condition or failure. The methods returning a value other than boolean return a value containing the higher level data produced by the FTP command, or null if a reply resulted in an error condition or failure. If you want to access the exact FTP reply code causing a success or failure, you must call getReplyCode after a success or failure. The default settings for FTPClient are for it to use FTP.ASCII_FILE_TYPE , FTP.NON_PRINT_TEXT_FORMAT , FTP.STREAM_TRANSFER_MODE , and FTP.FILE_STRUCTURE . The only file types directly supported are FTP.ASCII_FILE_TYPE and FTP.BINARY_FILE_TYPE . Because there are at least 4 different EBCDIC encodings, we have opted not to provide direct support for EBCDIC. To transfer EBCDIC and other unsupported file types you must create your own filter InputStreams and OutputStreams and wrap them around the streams returned or required by the FTPClient methods. FTPClient uses the NetASCII filter streams to provide transparent handling of ASCII files. We will consider incorporating EBCDIC support if there is enough demand. FTP.NON_PRINT_TEXT_FORMAT , FTP.STREAM_TRANSFER_MODE , and FTP.FILE_STRUCTURE are the only supported formats, transfer modes, and file structures. Because the handling of sockets on different platforms can differ significantly, the FTPClient automatically issues a new PORT (or EPRT) command prior to every transfer requiring that the server connect to the client's data port. This ensures identical problem-free behavior on Windows, Unix, and Macintosh platforms. Additionally, it relieves programmers from having to issue the PORT (or EPRT) command themselves and dealing with platform dependent issues. Additionally, for security purposes, all data connections to the client are verified to ensure that they originated from the intended party (host and port). If a data connection is initiated by an unexpected party, the command will close the socket and throw an IOException. You may disable this behavior with setRemoteVerificationEnabled(). You should keep in mind that the FTP server may choose to prematurely close a connection if the client has been idle for longer than a given time period (usually 900 seconds). The FTPClient class will detect a premature FTP server connection closing when it receives a FTPReply.SERVICE_NOT_AVAILABLE response to a command. When that occurs, the FTP class method encountering that reply will throw an FTPConnectionClosedException . FTPConnectionClosedException is a subclass of IOException and therefore need not be caught separately, but if you are going to catch it separately, its catch block must appear before the more general IOException catch block. When you encounter an FTPConnectionClosedException , you must disconnect the connection with disconnect() to properly clean up the system resources used by FTPClient. Before disconnecting, you may check the last reply code and text with getReplyCode , getReplyString , and getReplyStrings. You may avoid server disconnections while the client is idle by periodically sending NOOP commands to the server. Rather than list it separately for each method, we mention here that every method communicating with the server and throwing an IOException can also throw a MalformedServerReplyException , which is a subclass of IOException. A MalformedServerReplyException will be thrown when the reply received from the server deviates enough from the protocol specification that it cannot be interpreted in a useful manner despite attempts to be as lenient as possible. Listing API Examples Both paged and unpaged examples of directory listings are available, as follows: Unpaged (whole list) access, using a parser accessible by auto-detect: FTPClient f = new FTPClient(); f.connect(server); f.login(user, password); FTPFile[] files = f.listFiles(directory); Paged access, using a parser not accessible by auto-detect. The class defined in the first parameter of initateListParsing should be derived from org.apache.commons.net.FTPFileEntryParser: FTPClient f = new FTPClient(); f.connect(server); f.login(user, password); FTPListParseEngine engine = f.initiateListParsing("com.whatever.YourOwnParser", directory); while (engine.hasNext()) FTPFile[] files = engine.getNext(25); // "page size" you want // do whatever you want with these files, display them, etc. // expensive FTPFile objects not created until needed. Paged access, using a parser accessible by auto-detect: FTPClient f = new FTPClient(); f.connect(server); f.login(user, password); FTPListParseEngine engine = f.initiateListParsing(directory); while (engine.hasNext()) FTPFile[] files = engine.getNext(25); // "page size" you want // do whatever you want with these files, display them, etc. // expensive FTPFile objects not created until needed. For examples of using FTPClient on servers whose directory listings

  • use languages other than English
  • use date formats other than the American English "standard" MM d yyyy
  • are in different time zones and you need accurate timestamps for dependency checking as in Ant
see FTPClientConfig. Control channel keep-alive feature: Please note: this does not apply to the methods where the user is responsible for writing or reading the data stream, i.e. retrieveFileStream(String) , storeFileStream(String) and the other xxxFileStream methods During file transfers, the data connection is busy, but the control connection is idle. FTP servers know that the control connection is in use, so won't close it through lack of activity, but it's a lot harder for network routers to know that the control and data connections are associated with each other. Some routers may treat the control connection as idle, and disconnect it if the transfer over the data connection takes longer than the allowable idle time for the router.
One solution to this is to send a safe command (i.e. NOOP) over the control connection to reset the router's idle timer. This is enabled as follows: // Set timeout to 5 minutes ftpClient.setControlKeepAliveTimeout(Duration.ofMinutes(5)); This will cause the file upload/download methods to send a NOOP approximately every 5 minutes. The following public methods support this:
  • retrieveFile(String, OutputStream)
  • appendFile(String, InputStream)
  • storeFile(String, InputStream)
  • storeUniqueFile(InputStream)
  • storeUniqueFileStream(String)
This feature does not apply to the methods where the user is responsible for writing or reading the data stream, i.e. retrieveFileStream(String) , storeFileStream(String) and the other xxxFileStream methods. In such cases, the user is responsible for keeping the control connection alive if necessary. The implementation currently uses a CopyStreamListener which is passed to the Util.copyStream(InputStream, OutputStream, int, long, CopyStreamListener, boolean) method, so the timing is partially dependent on how long each block transfer takes. This keep-alive feature is optional; if it does not help or causes problems then don't use it.See Also:
  • FTP_SYSTEM_TYPE
  • SYSTEM_TYPE_PROPERTIES
  • FTP
  • FTPConnectionClosedException
  • FTPFileEntryParser
  • FTPFileEntryParserFactory
  • DefaultFTPFileEntryParserFactory
  • FTPClientConfig
  • MalformedServerReplyException
  • Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic interface FTPClient.HostnameResolverStrategy interface for updating host names received from FTP server for passive NAT workaround.static class FTPClient.NatServerResolverImplDefault strategy for passive NAT workaround (site-local replies are replaced.)
  • Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intACTIVE_LOCAL_DATA_CONNECTION_MODEA constant indicating the FTP session is expecting all transfers to occur between the client (local) and server and that the server should connect to the client's data port to initiate a data transfer.static final intACTIVE_REMOTE_DATA_CONNECTION_MODEA constant indicating the FTP session is expecting all transfers to occur between two remote servers and that the server the client is connected to should connect to the other server's data port to initiate a data transfer.static final StringFTP_IP_ADDRESS_FROM_PASV_RESPONSEThe system property that defines the default for isIpAddressFromPasvResponse().static final StringFTP_SYSTEM_TYPEThe system property ("org.apache.commons.net.ftp.systemType") which can be used to override the system type.
    If defined, the value will be used to create any automatically created parsers.static final StringFTP_SYSTEM_TYPE_DEFAULTThe system property ("org.apache.commons.net.ftp.systemType.default") which can be used as the default system type.
    If defined, the value will be used if the SYST command fails.static final intPASSIVE_LOCAL_DATA_CONNECTION_MODEA constant indicating the FTP session is expecting all transfers to occur between the client (local) and server and that the server is in passive mode, requiring the client to connect to the server's data port to initiate a transfer.static final intPASSIVE_REMOTE_DATA_CONNECTION_MODEA constant indicating the FTP session is expecting all transfers to occur between two remote servers and that the server the client is connected to is in passive mode, requiring the other server to connect to the first server's data port to initiate a data transfer.static final StringSYSTEM_TYPE_PROPERTIESThe name of an optional systemType properties file ("/systemType.properties"), which is loaded using Class.getResourceAsStream(String).
    The entries are the systemType (as determined by getSystemType()) and the values are the replacement type or parserClass, which is passed to FTPFileEntryParserFactory.createFileEntryParser(String).
    For example:Fields inherited from class org.apache.commons.net.ftp.FTP_commandSupport_, _controlEncoding, _controlInput_, _controlOutput_, _newReplyString, _replyCode, _replyLines, _replyString, ASCII_FILE_TYPE, BINARY_FILE_TYPE, BLOCK_TRANSFER_MODE, CARRIAGE_CONTROL_TEXT_FORMAT, COMPRESSED_TRANSFER_MODE, DEFAULT_CONTROL_ENCODING, DEFAULT_DATA_PORT, DEFAULT_PORT, EBCDIC_FILE_TYPE, FILE_STRUCTURE, LOCAL_FILE_TYPE, NON_PRINT_TEXT_FORMAT, PAGE_STRUCTURE, RECORD_STRUCTURE, REPLY_CODE_LEN, STREAM_TRANSFER_MODE, strictMultilineParsing, TELNET_TEXT_FORMATFields inherited from class org.apache.commons.net.SocketClient_defaultPort_, _hostname_, _input_, _output_, _serverSocketFactory_, _socket_, _socketFactory_, _timeout_, connectTimeout, NETASCII_EOL, remoteInetSocketAddress
  • Constructor SummaryConstructorsConstructorDescriptionFTPClient()Default FTPClient constructor.
  • Method SummaryAll MethodsInstance MethodsConcrete MethodsDeprecated MethodsModifier and TypeMethodDescriptionprotected void_connectAction_()Initiates control connections and gets initial reply.protected void_connectAction_(Reader socketIsReader)Initiates control connections and gets initial reply.protected Socket_openDataConnection_(int command, String arg)Deprecated.(3.3) Use _openDataConnection_(FTPCmd, String) insteadprotected Socket_openDataConnection_(String command, String arg)Establishes a data connection with the FTP server, returning a Socket for the connection if successful.protected Socket_openDataConnection_(FTPCmd command, String arg)Establishes a data connection with the FTP server, returning a Socket for the connection if successful.protected void_parseExtendedPassiveModeReply(String reply) protected void_parsePassiveModeReply(String reply) protected boolean_retrieveFile(String command, String remote, OutputStream local) protected InputStream_retrieveFileStream(String command, String remote) protected boolean_storeFile(String command, String remote, InputStream local) protected OutputStream_storeFileStream(String command, String remote) booleanabort()Abort a transfer in progress.booleanallocate(int bytes)Reserve a number of bytes on the server for the next file transfer.booleanallocate(int bytes, int recordSize)Reserve space on the server for the next file transfer.booleanallocate(long bytes)Reserve a number of bytes on the server for the next file transfer.booleanallocate(long bytes, int recordSize)Reserve space on the server for the next file transfer.booleanappendFile(String remote, InputStream local)Appends to a file on the server with the given name, taking input from the given InputStream.OutputStreamappendFileStream(String remote)Returns an OutputStream through which data can be written to append to a file on the server with the given name.booleanchangeToParentDirectory()Change to the parent directory of the current working directory.booleanchangeWorkingDirectory(String pathname)Change the current working directory of the FTP session.booleancompletePendingCommand()There are a few FTPClient methods that do not complete the entire sequence of FTP commands to complete a transaction.voidconfigure(FTPClientConfig config)Implementation of the Configurable interface.booleandeleteFile(String pathname)Deletes a file on the FTP server.voiddisconnect()Closes the connection to the FTP server and restores connection parameters to the default values.booleandoCommand(String command, String params)Issue a command and wait for the reply.String[]doCommandAsStrings(String command, String params)Issue a command and wait for the reply, returning it as an array of strings.voidenterLocalActiveMode()Set the current data connection mode to ACTIVE_LOCAL_DATA_CONNECTION_MODE.voidenterLocalPassiveMode()Set the current data connection mode to PASSIVE_LOCAL_DATA_CONNECTION_MODE .booleanenterRemoteActiveMode(InetAddress host, int port)Set the current data connection mode to ACTIVE_REMOTE_DATA_CONNECTION .booleanenterRemotePassiveMode()Set the current data connection mode to PASSIVE_REMOTE_DATA_CONNECTION_MODE .booleanfeatures()Queries the server for supported features.StringfeatureValue(String feature)Queries the server for a supported feature, and returns its value (if any).String[]featureValues(String feature)Queries the server for a supported feature, and returns its values (if any).booleangetAutodetectUTF8()Tells if automatic server encoding detection is enabled or disabled.intgetBufferSize()Retrieve the current internal buffer size for buffered data streams.intgetControlKeepAliveReplyTimeout()Deprecated.Use getControlKeepAliveReplyTimeoutDuration().DurationgetControlKeepAliveReplyTimeoutDuration()Gets how long to wait for control keep-alive message replies.longgetControlKeepAliveTimeout()Deprecated.Use getControlKeepAliveTimeoutDuration().DurationgetControlKeepAliveTimeoutDuration()Gets the time to wait between sending control connection keepalive messages when processing file upload or download.CopyStreamListenergetCopyStreamListener()Obtain the currently active listener.int[]getCslDebug()Deprecated.3.7 For testing only; may be dropped or changed at any timeintgetDataConnectionMode()Returns the current data connection mode (one of the _DATA_CONNECTION_MODE constants).DurationgetDataTimeout()Gets the timeout to use when reading from the data connection.protected StringgetListArguments(String pathname) booleangetListHiddenFiles() StringgetModificationTime(String pathname)Issue the FTP MDTM command (not supported by all servers) to retrieve the last modification time of a file.StringgetPassiveHost()Returns the hostname or IP address (in the form of a string) returned by the server when entering passive mode.InetAddressgetPassiveLocalIPAddress()Set the local IP address in passive mode.intgetPassivePort()If in passive mode, returns the data port of the passive host.intgetReceiveDataSocketBufferSize()Retrieve the value to be used for the data socket SO_RCVBUF option.longgetRestartOffset()Fetches the restart offset.intgetSendDataSocketBufferSize()Retrieve the value to be used for the data socket SO_SNDBUF option.StringgetSize(String pathname)Issue the FTP SIZE command to the server for a given pathname.StringgetStatus()Issue the FTP STAT command to the server.StringgetStatus(String pathname)Issue the FTP STAT command to the server for a given pathname.StringgetSystemName()Deprecated.use getSystemType() insteadStringgetSystemType()Fetches the system type from the server and returns the string.booleanhasFeature(String feature)Queries the server for a supported feature.booleanhasFeature(String feature, String value)Queries the server for a supported feature with particular value, for example "AUTH SSL" or "AUTH TLS".booleanhasFeature(FTPCmd feature)Queries the server for a supported feature.FTPListParseEngineinitiateListParsing()Using the default autodetect mechanism, initialize an FTPListParseEngine object containing a raw file information for the current working directory on the server This information is obtained through the LIST command.FTPListParseEngineinitiateListParsing(String pathname)Using the default autodetect mechanism, initialize an FTPListParseEngine object containing a raw file information for the supplied directory.FTPListParseEngineinitiateListParsing(String parserKey, String pathname)Using the supplied parser key, initialize an FTPListParseEngine object containing a raw file information for the supplied directory.FTPListParseEngineinitiateMListParsing()Initiate list parsing for MLSD listings in the current working directory.FTPListParseEngineinitiateMListParsing(String pathname)Initiate list parsing for MLSD listings.booleanisIpAddressFromPasvResponse()Returns, whether the IP address from the server's response should be used.booleanisRemoteVerificationEnabled()Return whether or not verification of the remote host participating in data connections is enabled.booleanisUseEPSVwithIPv4()Whether to attempt using EPSV with IPv4.FTPFile[]listDirectories()Using the default system autodetect mechanism, obtain a list of directories contained in the current working directory.FTPFile[]listDirectories(String parent)Using the default system autodetect mechanism, obtain a list of directories contained in the specified directory.FTPFile[]listFiles()Using the default system autodetect mechanism, obtain a list of file information for the current working directory.FTPFile[]listFiles(String pathname)Using the default system autodetect mechanism, obtain a list of file information for the current working directory or for just a single file.FTPFile[]listFiles(String pathname, FTPFileFilter filter)Version of listFiles(String) which allows a filter to be provided.StringlistHelp()Fetches the system help information from the server and returns the full string.StringlistHelp(String command)Fetches the help information for a given command from the server and returns the full string.String[]listNames()Obtain a list of file names in the current working directory This information is obtained through the NLST command.String[]listNames(String pathname)Obtain a list of file names in a directory (or just the name of a given file, which is not particularly useful).booleanlogin(String user, String password)Login to the FTP server using the provided user and password.booleanlogin(String user, String password, String account)Login to the FTP server using the provided username, password, and account.booleanlogout()Logout of the FTP server by sending the QUIT command.booleanmakeDirectory(String pathname)Creates a new subdirectory on the FTP server in the current directory (if a relative pathname is given) or where specified (if an absolute pathname is given).CalendarmdtmCalendar(String pathname)Issue the FTP MDTM command (not supported by all servers) to retrieve the last modification time of a file.FTPFilemdtmFile(String pathname)Issue the FTP MDTM command (not supported by all servers) to retrieve the last modification time of a file.InstantmdtmInstant(String pathname)Issue the FTP MDTM command (not supported by all servers) to retrieve the last modification time of a file.FTPFile[]mlistDir()Generate a directory listing for the current directory using the MLSD command.FTPFile[]mlistDir(String pathname)Generate a directory listing using the MLSD command.FTPFile[]mlistDir(String pathname, FTPFileFilter filter)Generate a directory listing using the MLSD command.FTPFilemlistFile(String pathname)Get file details using the MLST commandStringprintWorkingDirectory()Returns the pathname of the current working directory.booleanreinitialize()Reinitialize the FTP session.booleanremoteAppend(String fileName)Initiate a server to server file transfer.booleanremoteRetrieve(String fileName)Initiate a server to server file transfer.booleanremoteStore(String fileName)Initiate a server to server file transfer.booleanremoteStoreUnique()Initiate a server to server file transfer.booleanremoteStoreUnique(String fileName)Initiate a server to server file transfer.booleanremoveDirectory(String pathname)Removes a directory on the FTP server (if empty).booleanrename(String from, String to)Renames a remote file.protected booleanrestart(long offset)Restart a STREAM_TRANSFER_MODE file transfer starting from the given offset.booleanretrieveFile(String remote, OutputStream local)Retrieves a named file from the server and writes it to the given OutputStream.InputStreamretrieveFileStream(String remote)Returns an InputStream from which a named file from the server can be read.booleansendNoOp()Sends a NOOP command to the FTP server.booleansendSiteCommand(String arguments)Send a site specific command.voidsetActiveExternalIPAddress(String ipAddress)Set the external IP address in active mode.voidsetActivePortRange(int minPort, int maxPort)Set the client side port range in active mode.voidsetAutodetectUTF8(boolean autodetect)Enables or disables automatic server encoding detection (only UTF-8 supported).voidsetBufferSize(int bufSize)Set the internal buffer size for buffered data streams.voidsetControlKeepAliveReplyTimeout(int timeoutMillis)Deprecated.Use setControlKeepAliveReplyTimeout(Duration).voidsetControlKeepAliveReplyTimeout(Duration timeout)Sets the duration to wait for control keep-alive message replies.voidsetControlKeepAliveTimeout(long controlIdleSeconds)Deprecated.Use setControlKeepAliveTimeout(Duration).voidsetControlKeepAliveTimeout(Duration controlIdle)Sets the duration to wait between sending control connection keepalive messages when processing file upload or download.voidsetCopyStreamListener(CopyStreamListener listener)Set the listener to be used when performing store/retrieve operations.voidsetDataTimeout(int timeoutMillis)Deprecated.Use setDataTimeout(Duration).voidsetDataTimeout(Duration timeout)Sets the timeout to use when reading from the data connection.booleansetFileStructure(int structure)Sets the file structure.booleansetFileTransferMode(int mode)Sets the transfer mode.booleansetFileType(int fileType)Sets the file type to be transferred.booleansetFileType(int fileType, int formatOrByteSize)Sets the file type to be transferred and the format.voidsetIpAddressFromPasvResponse(boolean usingIpAddressFromPasvResponse)Sets whether the IP address from the server's response should be used.voidsetListHiddenFiles(boolean listHiddenFiles)You can set this to true if you would like to get hidden files when listFiles() too.booleansetModificationTime(String pathname, String timeval)Issue the FTP MFMT command (not supported by all servers) which sets the last modified time of a file.voidsetParserFactory(FTPFileEntryParserFactory parserFactory)set the factory used for parser creation to the supplied factory object.voidsetPassiveLocalIPAddress(String ipAddress)Set the local IP address to use in passive mode.voidsetPassiveLocalIPAddress(InetAddress inetAddress)Set the local IP address to use in passive mode.voidsetPassiveNatWorkaround(boolean enabled)Deprecated.(3.6) use setPassiveNatWorkaroundStrategy(HostnameResolver) insteadvoidsetPassiveNatWorkaroundStrategy(FTPClient.HostnameResolver resolver)Sets the workaround strategy to replace the PASV mode reply addresses.voidsetReceieveDataSocketBufferSize(int bufSize)Sets the value to be used for the data socket SO_RCVBUF option.voidsetRemoteVerificationEnabled(boolean enable)Enable or disable verification that the remote host taking part of a data connection is the same as the host to which the control connection is attached.voidsetReportActiveExternalIPAddress(String ipAddress)Sets the external IP address to report in EPRT/PORT commands in active mode.voidsetRestartOffset(long offset)Sets the restart offset for file transfers.voidsetSendDataSocketBufferSize(int bufSize)Sets the value to be used for the data socket SO_SNDBUF option.voidsetUseEPSVwithIPv4(boolean selected)Set whether to use EPSV with IPv4.booleanstoreFile(String remote, InputStream local)Stores a file on the server using the given name and taking input from the given InputStream.OutputStreamstoreFileStream(String remote)Returns an OutputStream through which data can be written to store a file on the server using the given name.booleanstoreUniqueFile(InputStream local)Stores a file on the server using a unique name assigned by the server and taking input from the given InputStream.booleanstoreUniqueFile(String remote, InputStream local)Stores a file on the server using a unique name derived from the given name and taking input from the given InputStream.OutputStreamstoreUniqueFileStream()Returns an OutputStream through which data can be written to store a file on the server using a unique name assigned by the server.OutputStreamstoreUniqueFileStream(String remote)Returns an OutputStream through which data can be written to store a file on the server using a unique name derived from the given name.booleanstructureMount(String pathname)Issue the FTP SMNT command.Methods inherited from class org.apache.commons.net.ftp.FTP__getReplyNoReport, __noop, abor, acct, allo, allo, allo, allo, appe, cdup, cwd, dele, eprt, epsv, feat, getCommandSupport, getControlEncoding, getReply, getReplyCode, getReplyString, getReplyStrings, help, help, isStrictMultilineParsing, isStrictReplyParsing, list, list, mdtm, mfmt, mkd, mlsd, mlsd, mlst, mlst, mode, nlst, nlst, noop, pass, pasv, port, pwd, quit, rein, rest, retr, rmd, rnfr, rnto, sendCommand, sendCommand, sendCommand, sendCommand, sendCommand, sendCommand, setControlEncoding, setStrictMultilineParsing, setStrictReplyParsing, site, size, smnt, stat, stat, stor, stou, stou, stru, syst, type, type, userMethods inherited from class org.apache.commons.net.SocketClientaddProtocolCommandListener, applySocketAttributes, connect, connect, connect, connect, connect, connect, createCommandSupport, fireCommandSent, fireReplyReceived, getCharset, getCharsetName, getConnectTimeout, getDefaultPort, getDefaultTimeout, getKeepAlive, getLocalAddress, getLocalPort, getProxy, getReceiveBufferSize, getRemoteAddress, getRemoteInetSocketAddress, getRemotePort, getSendBufferSize, getServerSocketFactory, getSoLinger, getSoTimeout, getTcpNoDelay, isAvailable, isConnected, removeProtocolCommandListener, setCharset, setConnectTimeout, setDefaultPort, setDefaultTimeout, setKeepAlive, setProxy, setReceiveBufferSize, setSendBufferSize, setServerSocketFactory, setSocketFactory, setSoLinger, setSoTimeout, setTcpNoDelay, verifyRemoteMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details
  • FTP_SYSTEM_TYPEpublic static final String FTP_SYSTEM_TYPEThe system property ("org.apache.commons.net.ftp.systemType") which can be used to override the system type.
    If defined, the value will be used to create any automatically created parsers.Since:3.0See Also:
  • Constant Field Values
  • FTP_SYSTEM_TYPE_DEFAULTpublic static final String FTP_SYSTEM_TYPE_DEFAULTThe system property ("org.apache.commons.net.ftp.systemType.default") which can be used as the default system type.
    If defined, the value will be used if the SYST command fails.Since:3.1See Also:
  • Constant Field Values
  • FTP_IP_ADDRESS_FROM_PASV_RESPONSEpublic static final String FTP_IP_ADDRESS_FROM_PASV_RESPONSEThe system property that defines the default for isIpAddressFromPasvResponse(). This property, if present, configures the default for the following: If the client receives the servers response for a PASV request, then that response will contain an IP address. If this property is true, then the client will use that IP address, as requested by the server. This is compatible to version 3.8.0, and before. If this property is false, or absent, then the client will ignore that IP address, and instead use the remote address of the control connection.Since:3.9.0See Also:
  • isIpAddressFromPasvResponse()
  • setIpAddressFromPasvResponse(boolean)
  • Constant Field Values
  • SYSTEM_TYPE_PROPERTIESpublic static final String SYSTEM_TYPE_PROPERTIESThe name of an optional systemType properties file ("/systemType.properties"), which is loaded using Class.getResourceAsStream(String).
    The entries are the systemType (as determined by getSystemType()) and the values are the replacement type or parserClass, which is passed to FTPFileEntryParserFactory.createFileEntryParser(String).
    For example: Plan 9=Unix OS410=org.apache.commons.net.ftp.parser.OS400FTPEntryParser Since:3.0See Also:
  • Constant Field Values
  • ACTIVE_LOCAL_DATA_CONNECTION_MODEpublic static final int ACTIVE_LOCAL_DATA_CONNECTION_MODEA constant indicating the FTP session is expecting all transfers to occur between the client (local) and server and that the server should connect to the client's

Reply all
Reply to author
Forward
0 new messages