Class DefaultFTPFileEntryParserFactory

    • Field Detail

      • JAVA_IDENTIFIER

        private static final java.lang.String JAVA_IDENTIFIER
        Match a plain Java Identifier
        See Also:
        Constant Field Values
      • JAVA_QUALIFIED_NAME

        private static final java.lang.String JAVA_QUALIFIED_NAME
        Match a qualified name, e.g. a.b.c.Name - but don't allow the default package as that would allow "VMS"/"UNIX" etc.
        See Also:
        Constant Field Values
      • JAVA_QUALIFIED_NAME_PATTERN

        private static final java.util.regex.Pattern JAVA_QUALIFIED_NAME_PATTERN
        Create the pattern, as it will be reused many times
    • Constructor Detail

      • DefaultFTPFileEntryParserFactory

        public DefaultFTPFileEntryParserFactory()
        Constructs a new instance.
    • Method Detail

      • createFileEntryParser

        public 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 class name (default package is not allowed) of a class implementing the FTPFileEntryParser interface. If that succeeds, a parser object of this class is instantiated and is returned; otherwise it attempts to interpret the key as an identifier commonly used by the FTP SYST command to identify systems.

        If key is not recognized as a fully qualified class name 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.

        Specified by:
        createFileEntryParser in interface FTPFileEntryParserFactory
        Parameters:
        key - should be a fully qualified class name corresponding to a class implementing the FTPFileEntryParser interface
        OR
        a string containing (case-insensitively) one of the following keywords:
        Returns:
        the FTPFileEntryParser corresponding to the supplied key.
        Throws:
        ParserInitializationException - thrown if for any reason the factory cannot resolve the supplied key into an FTPFileEntryParser.
        See Also:
        FTPFileEntryParser
      • createMVSEntryParser

        public FTPFileEntryParser createMVSEntryParser()
        Creates a new MVSFTPEntryParser.
        Returns:
        a new MVSFTPEntryParser.
      • createNetwareFTPEntryParser

        public FTPFileEntryParser createNetwareFTPEntryParser()
        Creates a new NetwareFTPEntryParser.
        Returns:
        a new NetwareFTPEntryParser.
      • createNTFTPEntryParser

        public FTPFileEntryParser createNTFTPEntryParser()
        Creates a new FTPFileEntryParser.
        Returns:
        a new FTPFileEntryParser.
      • createOS2FTPEntryParser

        public FTPFileEntryParser createOS2FTPEntryParser()
        Creates a new OS2FTPEntryParser.
        Returns:
        a new OS2FTPEntryParser.
      • createOS400FTPEntryParser

        public FTPFileEntryParser createOS400FTPEntryParser()
        Creates a new FTPFileEntryParser.
        Returns:
        a new FTPFileEntryParser.
      • createUnixFTPEntryParser

        public FTPFileEntryParser createUnixFTPEntryParser()
        Creates a new UnixFTPEntryParser.
        Returns:
        a new UnixFTPEntryParser.
      • createVMSVersioningFTPEntryParser

        public FTPFileEntryParser createVMSVersioningFTPEntryParser()
        Creates a new VMSVersioningFTPEntryParser.
        Returns:
        a new VMSVersioningFTPEntryParser.