/** * Creates an NT FTP parser: if the config exists, and the system key equals * {@link FTPClientConfig.SYST_NT} then a plain {@link NTFTPEntryParser} is used, * otherwise a composite of {@link NTFTPEntryParser} and {@link UnixFTPEntryParser} is used. * @param config the config to use, may be {@code null} * @return the parser */ private FTPFileEntryParser createNTFTPEntryParser(FTPClientConfig config) { if (config != null && FTPClientConfig.SYST_NT.equals( config.getServerSystemKey())) { return new NTFTPEntryParser(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 NTFTPEntryParser(config), new UnixFTPEntryParser(config2, config2 != null && FTPClientConfig.SYST_UNIX_TRIM_LEADING.equals(config2.getServerSystemKey())) }); } }
/** * This constructor allows the creation of an NTFTPEntryParser 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 NTFTPEntryParser(FTPClientConfig config) { super(REGEX, Pattern.DOTALL); configure(config); FTPClientConfig config2 = new FTPClientConfig( FTPClientConfig.SYST_NT, DEFAULT_DATE_FORMAT2, null); config2.setDefaultDateFormatStr(DEFAULT_DATE_FORMAT2); this.timestampParser = new FTPTimestampParserImpl(); ((Configurable)this.timestampParser).configure(config2); }
@Override public FTPClientConfig getDefaultConfiguration() { final FTPClientConfig config = super.getDefaultConfiguration(); config.setServerTimeZoneId(timezone.getID()); return config; } },
public FTPFileEntryParser createNTFTPEntryParser() { if (config != null && FTPClientConfig.SYST_NT.equals( config.getServerSystemKey())) { return new NTFTPEntryParser(); } else { return new CompositeFileEntryParser(new FTPFileEntryParser[] { new NTFTPEntryParser(), new UnixFTPEntryParser() }); } }
/** * This constructor allows the creation of an NTFTPEntryParser 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 NTFTPEntryParser(FTPClientConfig config) { super(REGEX); configure(config); }
public FTPFileEntryParser createNTFTPEntryParser() { if (config != null && FTPClientConfig.SYST_NT.equals( config.getServerSystemKey())) { return new NTFTPEntryParser(); } else { return new CompositeFileEntryParser(new FTPFileEntryParser[] { new NTFTPEntryParser(), new UnixFTPEntryParser() }); } }
/** * This constructor allows the creation of an NTFTPEntryParser 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 NTFTPEntryParser(FTPClientConfig config) { super(REGEX); configure(config); }
/** * Creates an NT FTP parser: if the config exists, and the system key equals * {@link FTPClientConfig#SYST_NT} then a plain {@link NTFTPEntryParser} is used, * otherwise a composite of {@link NTFTPEntryParser} and {@link UnixFTPEntryParser} is used. * @param config the config to use, may be {@code null} * @return the parser */ private FTPFileEntryParser createNTFTPEntryParser(FTPClientConfig config) { if (config != null && FTPClientConfig.SYST_NT.equals( config.getServerSystemKey())) { return new NTFTPEntryParser(config); } else { return new CompositeFileEntryParser(new FTPFileEntryParser[] { new NTFTPEntryParser(config), new UnixFTPEntryParser(config) }); } }