org.apache.commons.net.ftp.parser
public class FTPTimestampParserImpl extends Object implements FTPTimestampParser, Configurable
Since: 1.4
See Also: ConfigurableFTPFileEntryParserImpl
| Constructor Summary | |
|---|---|
| FTPTimestampParserImpl()
The only constructor for this class. | |
| Method Summary | |
|---|---|
| void | configure(FTPClientConfig config)
Implementation of the {@link Configurable Configurable}
interface. |
| SimpleDateFormat | getDefaultDateFormat() |
| String | getDefaultDateFormatString() |
| SimpleDateFormat | getRecentDateFormat() |
| String | getRecentDateFormatString() |
| TimeZone | getServerTimeZone() |
| String[] | getShortMonths() |
| Calendar | parseTimestamp(String timestampStr)
Implements the one {@link FTPTimestampParser#parseTimestamp(String) method}
in the {@link FTPTimestampParser FTPTimestampParser} interface
according to this algorithm:
If the recentDateFormat member has been defined, try to parse the
supplied string with that. |
FTPTimestampParser according
to the following logic:
Set up the {@link FTPClientConfig#setDefaultDateFormatStr(java.lang.String) defaultDateFormat} and optionally the {@link FTPClientConfig#setRecentDateFormatStr(String) recentDateFormat} to values supplied in the config based on month names configured as follows:
config, use that to parse parse timestamps.config, use the month names represented
by that {@link FTPClientConfig#lookupDateFormatSymbols(String) language}
to parse timestamps.Finally if a {@link org.apache.commons.net.ftp.FTPClientConfig#setServerTimeZoneId(String) 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.
See Also: FTPTimestampParser