public class DefaultFTPFileEntryParserFactory extends java.lang.Object implements FTPFileEntryParserFactory
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
JAVA_IDENTIFIER |
private static java.lang.String |
JAVA_QUALIFIED_NAME |
private static java.util.regex.Pattern |
JAVA_QUALIFIED_NAME_PATTERN |
Constructor and Description |
---|
DefaultFTPFileEntryParserFactory() |
Modifier and Type | Method and Description |
---|---|
FTPFileEntryParser |
createFileEntryParser(FTPClientConfig config)
Implementation extracts a key from the supplied
FTPClientConfig
parameter and creates an object implementing the
interface FTPFileEntryParser and uses the supplied configuration
to configure it. |
FTPFileEntryParser |
createFileEntryParser(java.lang.String key)
This default implementation of the FTPFileEntryParserFactory
interface works according to the following logic:
First it attempts to interpret the supplied key as a fully
qualified classname (default package is not allowed) of a class implementing the
FTPFileEntryParser interface.
|
private FTPFileEntryParser |
createFileEntryParser(java.lang.String key,
FTPClientConfig config) |
FTPFileEntryParser |
createMVSEntryParser() |
FTPFileEntryParser |
createNetwareFTPEntryParser() |
FTPFileEntryParser |
createNTFTPEntryParser() |
private FTPFileEntryParser |
createNTFTPEntryParser(FTPClientConfig config)
Creates an NT FTP parser: if the config exists, and the system key equals
FTPClientConfig.SYST_NT then a plain NTFTPEntryParser is used,
otherwise a composite of NTFTPEntryParser and UnixFTPEntryParser is used. |
FTPFileEntryParser |
createOS2FTPEntryParser() |
FTPFileEntryParser |
createOS400FTPEntryParser() |
private FTPFileEntryParser |
createOS400FTPEntryParser(FTPClientConfig config)
Creates an OS400 FTP parser: if the config exists, and the system key equals
FTPClientConfig.SYST_OS400 then a plain OS400FTPEntryParser is used,
otherwise a composite of OS400FTPEntryParser and UnixFTPEntryParser is used. |
FTPFileEntryParser |
createUnixFTPEntryParser() |
FTPFileEntryParser |
createVMSVersioningFTPEntryParser() |
private static final java.lang.String JAVA_IDENTIFIER
private static final java.lang.String JAVA_QUALIFIED_NAME
private static final java.util.regex.Pattern JAVA_QUALIFIED_NAME_PATTERN
public FTPFileEntryParser createFileEntryParser(java.lang.String key)
If key
is not recognized as a fully qualified
classname known to the system, this method will then attempt
to see whether it contains a string identifying one of
the known parsers. This comparison is case-insensitive.
The intent here is where possible, to select as keys strings
which are returned by the SYST command on the systems which
the corresponding parser successfully parses. This enables
this factory to be used in the auto-detection system.
createFileEntryParser
in interface FTPFileEntryParserFactory
key
- should be a fully qualified classname corresponding to
a class implementing the FTPFileEntryParser interfaceParserInitializationException
- thrown if for any reason the factory cannot resolve
the supplied key into an FTPFileEntryParser.FTPFileEntryParser
private FTPFileEntryParser createFileEntryParser(java.lang.String key, FTPClientConfig config)
public FTPFileEntryParser createFileEntryParser(FTPClientConfig config) throws ParserInitializationException
Implementation extracts a key from the supplied
FTPClientConfig
parameter and creates an object implementing the
interface FTPFileEntryParser and uses the supplied configuration
to configure it.
Note that this method will generally not be called in scenarios that call for autodetection of parser type but rather, for situations where the user knows that the server uses a non-default configuration and knows what that configuration is.
createFileEntryParser
in interface FTPFileEntryParserFactory
config
- A FTPClientConfig
used to configure the parser createdParserInitializationException
- Thrown on any exception in instantiationjava.lang.NullPointerException
- if config
is null
public FTPFileEntryParser createUnixFTPEntryParser()
public FTPFileEntryParser createVMSVersioningFTPEntryParser()
public FTPFileEntryParser createNetwareFTPEntryParser()
public FTPFileEntryParser createNTFTPEntryParser()
private FTPFileEntryParser createNTFTPEntryParser(FTPClientConfig config)
FTPClientConfig.SYST_NT
then a plain NTFTPEntryParser
is used,
otherwise a composite of NTFTPEntryParser
and UnixFTPEntryParser
is used.config
- the config to use, may be null
public FTPFileEntryParser createOS2FTPEntryParser()
public FTPFileEntryParser createOS400FTPEntryParser()
private FTPFileEntryParser createOS400FTPEntryParser(FTPClientConfig config)
FTPClientConfig.SYST_OS400
then a plain OS400FTPEntryParser
is used,
otherwise a composite of OS400FTPEntryParser
and UnixFTPEntryParser
is used.config
- the config to use, may be null
public FTPFileEntryParser createMVSEntryParser()