org.apache.commons.net.ftp.parser
public class FTPTimestampParserImpl extends Object implements FTPTimestampParser, Configurable
FTPTimestampParser
interface also implements the Configurable
interface to allow the parsing to be configured from the outside.
Since: 1.4
See Also: ConfigurableFTPFileEntryParserImpl
Constructor Summary | |
---|---|
FTPTimestampParserImpl()
The only constructor for this class. |
Method Summary | |
---|---|
void | configure(FTPClientConfig config)
Implementation of the Configurable
interface. |
SimpleDateFormat | getDefaultDateFormat() |
String | getDefaultDateFormatString() |
SimpleDateFormat | getRecentDateFormat() |
String | getRecentDateFormatString() |
TimeZone | getServerTimeZone() |
String[] | getShortMonths() |
Calendar | parseTimestamp(String timestampStr)
Implements the one method
in the FTPTimestampParser interface
according to this algorithm:
If the recentDateFormat member has been defined, try to parse the
supplied string with that. |
Configurable
interface. Configures this FTPTimestampParser
according
to the following logic:
Set up the defaultDateFormat
and optionally the recentDateFormat
to values supplied in the config based on month names configured as follows:
shortMonthString
has been supplied in the config
, use that to parse parse timestamps. serverLanguageCode
has been supplied in the config
, use the month names represented
by that language
to parse timestamps.
Finally if a serverTimeZoneId
has been supplied via the config, set that into all date formats that have
been configured.
Returns: Returns the defaultDateFormat.
Returns: Returns the defaultDateFormat pattern string.
Returns: Returns the recentDateFormat.
Returns: Returns the recentDateFormat.
Returns: Returns the serverTimeZone used by this parser.
Returns: returns an array of 12 strings representing the short month names used by this parse.
method
in the FTPTimestampParser
interface
according to this algorithm:
If the recentDateFormat member has been defined, try to parse the
supplied string with that. If that parse fails, or if the recentDateFormat
member has not been defined, attempt to parse with the defaultDateFormat
member. If that fails, throw a ParseException.
See Also: FTPTimestampParser