/** * constructor for this abstract class. * @param regex Regular expression used main parsing of the * file listing. */ public ConfigurableFTPFileEntryParserImpl(String regex) { super(regex); this.timestampParser = new FTPTimestampParserImpl(); }
/** * Alter the current regular expression being utilised for entry parsing * and create a new {@link Pattern} instance. * @param regex The new regular expression * @return true * @since 2.0 * @throws IllegalArgumentException if the regex cannot be compiled */ public boolean setRegex(final String regex) { compileRegex(regex, 0); return true; }
/** * The only constructor for this class. */ public FTPTimestampParserImpl() { setDefaultDateFormat(DEFAULT_SDF, null); setRecentDateFormat(DEFAULT_RECENT_SDF, null); }
public FTPFileEntryParser createOS2FTPEntryParser() { return new OS2FTPEntryParser(); }
public FTPFileEntryParser createMVSEntryParser() { return new MVSFTPEntryParser(); }
public FTPFileEntryParser createUnixFTPEntryParser() { return new UnixFTPEntryParser(); }
public FTPFileEntryParser createVMSVersioningFTPEntryParser() { return new VMSVersioningFTPEntryParser(); }
public FTPFileEntryParser createNTFTPEntryParser() { return createNTFTPEntryParser(null); }
public FTPFileEntryParser createOS400FTPEntryParser() { return createOS400FTPEntryParser(null); }
/** * This method is called by the concrete parsers to delegate * timestamp parsing to the timestamp parser. * * @param timestampStr the timestamp string pulled from the * file listing by the regular expression parser, to be submitted * to the <code>timestampParser</code> for extracting the timestamp. * @return a <code>java.util.Calendar</code> containing results of the * timestamp parse. * @throws ParseException on parse error */ public Calendar parseTimestamp(String timestampStr) throws ParseException { return this.timestampParser.parseTimestamp(timestampStr); }
public FTPFileEntryParser createNetwareFTPEntryParser() { return new NetwareFTPEntryParser(); }
/** * This constructor allows the creation of an OS400FTPEntryParser object * with something other than the default configuration. * * @param config The {@link FTPClientConfig configuration} object used to * configure this parser. * @throws IllegalArgumentException * Thrown if the regular expression is unparseable. Should not be seen * under normal conditions. It it is seen, this is a sign that * <code>REGEX</code> is not a valid regular expression. * @since 1.4 */ public OS400FTPEntryParser(FTPClientConfig config) { super(REGEX); configure(config); }
/** * The sole constructor for a MVSFTPEntryParser object. * */ public MVSFTPEntryParser() { super(""); // note the regex is set in preParse. super.configure(null); // configure parser with default configurations }
/** * Parse the entry as a standard unix file. Using the UnixFTPEntryParser. * * @param file * @param entry * @return true: entry is parsed, false: entry could not be parsed. */ private boolean parseUnixList(FTPFile file, String entry) { file = unixFTPEntryParser.parseFTPEntry(entry); if (file == null) { return false; } return true; }
/** * This constructor allows the creation of an NetwareFTPEntryParser object * with something other than the default configuration. * * @param config The {@link FTPClientConfig configuration} object used to * configure this parser. * @throws IllegalArgumentException * Thrown if the regular expression is unparseable. Should not be seen * under normal conditions. It it is seen, this is a sign that * <code>REGEX</code> is not a valid regular expression. * @since 1.4 */ public NetwareFTPEntryParser(FTPClientConfig config) { super(REGEX); configure(config); }
public static FTPFile parseEntry(String entry) { return PARSER.parseFTPEntry(entry); }
/** * This constructor allows the creation of a UnixFTPEntryParser object with * something other than the default configuration. * * @param config The {@link FTPClientConfig configuration} object used to * configure this parser. * @throws IllegalArgumentException * Thrown if the regular expression is unparseable. Should not be seen * under normal conditions. It it is seen, this is a sign that * <code>REGEX</code> is not a valid regular expression. * @since 1.4 */ public MacOsPeterFTPEntryParser(FTPClientConfig config) { super(REGEX); configure(config); }
/** * constructor for this abstract class. * @param regex Regular expression used main parsing of the * file listing. * @param flags the flags to apply, see * {@link java.util.regex.Pattern#compile(String, int) Pattern#compile(String, int)}. Use 0 for none. * @since 3.4 */ public ConfigurableFTPFileEntryParserImpl(String regex, int flags) { super(regex, flags); this.timestampParser = new FTPTimestampParserImpl(); }
/** * Alter the current regular expression being utilised for entry parsing * and create a new {@link Pattern} instance. * @param regex The new regular expression * @param flags the flags to apply, see {@link Pattern#compile(String, int)}. Use 0 for none. * @return true * @since 3.4 * @throws IllegalArgumentException if the regex cannot be compiled */ public boolean setRegex(final String regex, final int flags) { compileRegex(regex, flags); return true; }
/** * The constructor for a RegexFTPFileEntryParserImpl object. * The expression is compiled with flags = 0. * * @param regex The regular expression with which this object is * initialized. * * @throws IllegalArgumentException * Thrown if the regular expression is unparseable. Should not be seen in * normal conditions. It it is seen, this is a sign that a subclass has * been created with a bad regular expression. Since the parser must be * created before use, this means that any bad parser subclasses created * from this will bomb very quickly, leading to easy detection. */ public RegexFTPFileEntryParserImpl(String regex) { super(); compileRegex(regex, 0); }