public FTPFileEntryParser createUnixFTPEntryParser() { return new UnixFTPEntryParser(); }
/** * 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. * @param trimLeadingSpaces if {@code true}, trim leading spaces from file names * @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 3.4 */ public UnixFTPEntryParser(FTPClientConfig config, boolean trimLeadingSpaces) { super(REGEX); configure(config); this.trimLeadingSpaces = trimLeadingSpaces; }
boolean isDevice = false; if (matches(entry)) String typeStr = group(1); String hardLinkCount = group(15); String usr = group(16); String grp = group(17); String filesize = group(18); String datestr = group(19) + " " + group(20); String name = group(21); if (trimLeadingSpaces) { name = name.replaceFirst("^\\s+", ""); if (group(19).contains(JA_MONTH)) { // special processing for Japanese format FTPTimestampParserImpl jaParser = new FTPTimestampParserImpl(); jaParser.configure(new FTPClientConfig( (!group(g).equals("-"))); file.setPermission(access, FTPFile.WRITE_PERMISSION, (!group(g + 1).equals("-"))); String execPerm = group(g + 2); if (!execPerm.equals("-") && !Character.isUpperCase(execPerm.charAt(0)))
/** * 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; }
/** * 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; }
/** * 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())) }); } }
boolean isDevice = false; if (matches(entry)) String typeStr = group(1); String hardLinkCount = group(15); String usr = group(16); String grp = group(17); String filesize = group(18); String datestr = group(19) + " " + group(20); String name = group(21); String endtoken = group(22); (!group(g).equals("-"))); file.setPermission(access, FTPFile.WRITE_PERMISSION, (!group(g + 1).equals("-"))); String execPerm = group(g + 2); if (!execPerm.equals("-") && !Character.isUpperCase(execPerm.charAt(0)))
/** * 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. * @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 UnixFTPEntryParser(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 { // 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())) }); } }
boolean isDevice = false; if (matches(entry)) String typeStr = group(1); String hardLinkCount = group(15); String usr = group(16); String grp = group(17); String filesize = group(18); String datestr = group(19) + " " + group(20); String name = group(21); String endtoken = group(22); (!group(g).equals("-"))); file.setPermission(access, FTPFile.WRITE_PERMISSION, (!group(g + 1).equals("-"))); String execPerm = group(g + 2); if (!execPerm.equals("-") && !Character.isUpperCase(execPerm.charAt(0)))
/** * 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. * @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 UnixFTPEntryParser(FTPClientConfig config) { super(REGEX); configure(config); }
if (ukey.indexOf(FTPClientConfig.SYST_UNIX_TRIM_LEADING) >= 0) parser = new UnixFTPEntryParser(config, true); parser = new UnixFTPEntryParser(config, false); parser = new UnixFTPEntryParser(config);
} else if (header.indexOf("total") == 0) { setType(UNIX_LIST_TYPE); unixFTPEntryParser = new UnixFTPEntryParser(); } else if (header.indexOf("Spool Files") >= 30) { setType(JES_LEVEL_1_LIST_TYPE);
public FTPFileEntryParser createUnixFTPEntryParser() { return (FTPFileEntryParser) new UnixFTPEntryParser(); }
public FTPFileEntryParser createUnixFTPEntryParser() { return new UnixFTPEntryParser(); }
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() }); } }
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() }); } }
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() }); } }
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() }); } }
/** * 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) }); } } }