1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.net.ftp.parser;
17
18 import java.text.ParseException;
19 import java.util.Calendar;
20
21 /**
22 * This interface specifies the concept of parsing an FTP server's
23 * timestamp.
24 * @since 1.4
25 */
26 public interface FTPTimestampParser {
27
28 /**
29 * the default default date format.
30 */
31 public static final String DEFAULT_SDF = UnixFTPEntryParser.DEFAULT_DATE_FORMAT;
32 /**
33 * the default recent date format.
34 */
35 public static final String DEFAULT_RECENT_SDF = UnixFTPEntryParser.DEFAULT_RECENT_DATE_FORMAT;
36
37 /**
38 * Parses the supplied datestamp parameter. This parameter typically would
39 * have been pulled from a longer FTP listing via the regular expression
40 * mechanism
41 * @param timestampStr - the timestamp portion of the FTP directory listing
42 * to be parsed
43 * @return a <code>java.util.Calendar</code> object initialized to the date
44 * parsed by the parser
45 * @throws ParseException if none of the parser mechanisms belonging to
46 * the implementor can parse the input.
47 */
48 public Calendar parseTimestamp(String timestampStr) throws ParseException;
49
50 }