1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.net.ftp.parser;
17 import org.apache.commons.net.ftp.FTPClientConfig;
18 import org.apache.commons.net.ftp.FTPFileEntryParser;
19
20 /**
21 * The interface describes a factory for creating FTPFileEntryParsers.
22 * @since 1.2
23 */
24 public interface FTPFileEntryParserFactory
25 {
26 /**
27 * Implementation should be a method that decodes the
28 * supplied key and creates an object implementing the
29 * interface FTPFileEntryParser.
30 *
31 * @param key A string that somehow identifies an
32 * FTPFileEntryParser to be created.
33 *
34 * @return the FTPFileEntryParser created.
35 * @exception ParserInitializationException
36 * Thrown on any exception in instantiation
37 */
38 public FTPFileEntryParser createFileEntryParser(String key)
39 throws ParserInitializationException;
40
41 /**
42 *<p>
43 * Implementation should be a method that extracts
44 * a key from the supplied {@link FTPClientConfig FTPClientConfig}
45 * parameter and creates an object implementing the
46 * interface FTPFileEntryParser and uses the supplied configuration
47 * to configure it.
48 * </p><p>
49 * Note that this method will generally not be called in scenarios
50 * that call for autodetection of parser type but rather, for situations
51 * where the user knows that the server uses a non-default configuration
52 * and knows what that configuration is.
53 * </p>
54 *
55 * @param config A {@link FTPClientConfig FTPClientConfig}
56 * used to configure the parser created
57 *
58 * @return the @link FTPFileEntryParser FTPFileEntryParser} so created.
59 * @exception ParserInitializationException
60 * Thrown on any exception in instantiation
61 * @since 1.4
62 */
63 public FTPFileEntryParser createFileEntryParser(FTPClientConfig config)
64 throws ParserInitializationException;
65
66 }