/** * Creates an OS400 FTP parser: if the config exists, and the system key equals * {@link FTPClientConfig.SYST_OS400} then a plain {@link OS400FTPEntryParser} is used, * otherwise a composite of {@link OS400FTPEntryParser} and {@link UnixFTPEntryParser} is used. * @param config the config to use, may be {@code null} * @return the parser */ private FTPFileEntryParser createOS400FTPEntryParser(FTPClientConfig config) { if (config != null && FTPClientConfig.SYST_OS400.equals(config.getServerSystemKey())) { return new OS400FTPEntryParser(config); } else { // clone the config as it may be changed by the parsers (NET-602) final FTPClientConfig config2 = (config != null) ? new FTPClientConfig(config) : null; return new CompositeFileEntryParser(new FTPFileEntryParser[] { new OS400FTPEntryParser(config), new UnixFTPEntryParser(config2, config2 != null && FTPClientConfig.SYST_UNIX_TRIM_LEADING.equals(config2.getServerSystemKey())) }); } }
/** * 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); }
int type; if (matches(entry)) String usr = group(1); String filesize = group(2); String datestr = ""; if (!isNullOrEmpty(group(3)) || !isNullOrEmpty(group(4))) datestr = group(3)+" "+group(4); String typeStr = group(5); String name = group(6); if (isNullOrEmpty(filesize) || isNullOrEmpty(name)) if (isNullOrEmpty(filesize) || isNullOrEmpty(name)) type = FTPFile.FILE_TYPE; if (isNullOrEmpty(name)) if (!(isNullOrEmpty(filesize) && isNullOrEmpty(datestr)))
@Override protected FTPClientConfig getDefaultConfiguration() { final FTPClientConfig config = super.getDefaultConfiguration(); config.setServerTimeZoneId(timezone.getID()); return config; } },
public FTPFileEntryParser createOS400FTPEntryParser() { if (config != null && FTPClientConfig.SYST_OS400.equals(config.getServerSystemKey())) { return new OS400FTPEntryParser(); } else { return new CompositeFileEntryParser(new FTPFileEntryParser[] { new OS400FTPEntryParser(), new UnixFTPEntryParser() }); } }
/** * 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. * @exception 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); }
public FTPFileEntryParser createOS400FTPEntryParser() { if (config != null && FTPClientConfig.SYST_OS400.equals(config.getServerSystemKey())) { return new OS400FTPEntryParser(); } else { return new CompositeFileEntryParser(new FTPFileEntryParser[] { new OS400FTPEntryParser(), new UnixFTPEntryParser() }); } }
/** * 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. * @exception 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); }
/** * Creates an OS400 FTP parser: if the config exists, and the system key equals * {@link FTPClientConfig#SYST_OS400} then a plain {@link OS400FTPEntryParser} is used, * otherwise a composite of {@link OS400FTPEntryParser} and {@link UnixFTPEntryParser} is used. * @param config the config to use, may be {@code null} * @return the parser */ private FTPFileEntryParser createOS400FTPEntryParser(FTPClientConfig config) { if (config != null && FTPClientConfig.SYST_OS400.equals(config.getServerSystemKey())) { return new OS400FTPEntryParser(config); } else { return new CompositeFileEntryParser(new FTPFileEntryParser[] { new OS400FTPEntryParser(config), new UnixFTPEntryParser(config) }); } } }