@Override public FTPFile parseFTPEntry(String listEntry) { if (cachedFtpFileEntryParser != null) { FTPFile matched = cachedFtpFileEntryParser.parseFTPEntry(listEntry); if (matched != null) { return matched; } } else { for (FTPFileEntryParser ftpFileEntryParser : ftpFileEntryParsers) { FTPFile matched = ftpFileEntryParser.parseFTPEntry(listEntry); if (matched != null) { cachedFtpFileEntryParser = ftpFileEntryParser; return matched; } } } return null; } }
while (count > 0 && this._internalIterator.hasPrevious()) { String entry = this._internalIterator.previous(); FTPFile temp = this.parser.parseFTPEntry(entry); if (temp == null && saveUnparseableEntries) { temp = new FTPFile(entry);
while (count > 0 && this._internalIterator.hasNext()) { String entry = this._internalIterator.next(); FTPFile temp = this.parser.parseFTPEntry(entry); if (temp == null && saveUnparseableEntries) { temp = new FTPFile(entry);
while (iter.hasNext()) { String entry = iter.next(); FTPFile temp = this.parser.parseFTPEntry(entry); if (temp == null && saveUnparseableEntries) { temp = new FTPFile(entry);
/** * Delegates to this object's parser member the job of parsing an * entry. * * @param entry A string containing one entry, as determined by the * parser's getNextEntry() method. * * @return an FTPFile object representing this entry or null if it can't be * parsed as a file */ private FTPFile parseFTPEntry(String entry) { return this.parser.parseFTPEntry(entry); }
public FTPFile parseFTPEntry(String listEntry) { if (cachedFtpFileEntryParser != null) { FTPFile matched = cachedFtpFileEntryParser.parseFTPEntry(listEntry); if (matched != null) { return matched; } } else { for (int iterParser=0; iterParser < ftpFileEntryParsers.length; iterParser++) { FTPFileEntryParser ftpFileEntryParser = ftpFileEntryParsers[iterParser]; FTPFile matched = ftpFileEntryParser.parseFTPEntry(listEntry); if (matched != null) { cachedFtpFileEntryParser = ftpFileEntryParser; return matched; } } } return null; } }
public FTPFile parseFTPEntry(String listEntry) { if (cachedFtpFileEntryParser != null) { FTPFile matched = cachedFtpFileEntryParser.parseFTPEntry(listEntry); if (matched != null) { return matched; } } else { for (int iterParser=0; iterParser < ftpFileEntryParsers.length; iterParser++) { FTPFileEntryParser ftpFileEntryParser = ftpFileEntryParsers[iterParser]; FTPFile matched = ftpFileEntryParser.parseFTPEntry(listEntry); if (matched != null) { cachedFtpFileEntryParser = ftpFileEntryParser; return matched; } } } return null; } }
/** * Returns an array of FTPFile objects containing the whole list of * files returned by the server as read by this object's parser. * * @return an array of FTPFile objects containing the whole list of * files returned by the server as read by this object's parser. * <p><b> * NOTE:</b> This array may contain null members if any of the * individual file listings failed to parse. The caller should * check each entry for null before referencing it. * @exception IOException */ public FTPFile[] getFiles() throws IOException { List tmpResults = new LinkedList(); Iterator iter = this.entries.iterator(); while (iter.hasNext()) { String entry = (String) iter.next(); FTPFile temp = this.parser.parseFTPEntry(entry); tmpResults.add(temp); } return (FTPFile[]) tmpResults.toArray(new FTPFile[0]); }
/** * Returns an array of FTPFile objects containing the whole list of * files returned by the server as read by this object's parser. * * @return an array of FTPFile objects containing the whole list of * files returned by the server as read by this object's parser. * <p><b> * NOTE:</b> This array may contain null members if any of the * individual file listings failed to parse. The caller should * check each entry for null before referencing it. * @exception IOException */ public FTPFile[] getFiles() throws IOException { List<FTPFile> tmpResults = new LinkedList<FTPFile>(); Iterator<String> iter = this.entries.iterator(); while (iter.hasNext()) { String entry = iter.next(); FTPFile temp = this.parser.parseFTPEntry(entry); tmpResults.add(temp); } return tmpResults.toArray(new FTPFile[0]); }
@Override public FTPFile parseFTPEntry(final String line) { if(log.isDebugEnabled()) { log.debug(String.format("Parse %s", line)); } if(current != null) { final FTPFile parsed = current.parseFTPEntry(line); if(null != parsed) { return parsed; } if(log.isInfoEnabled()) { log.info(String.format("Switching parser implementation because %s failed", current)); } current = null; } for(FTPFileEntryParser parser : parsers) { final FTPFile matched = parser.parseFTPEntry(line); if(matched != null) { current = parser; if(log.isInfoEnabled()) { log.info(String.format("Caching %s parser implementation", current)); } return matched; } } log.warn(String.format("Failure parsing line %s", line)); return null; }
while (count > 0 && this._internalIterator.hasNext()) { String entry = (String) this._internalIterator.next(); FTPFile temp = this.parser.parseFTPEntry(entry); tmpResults.add(temp); count--;
while (count > 0 && this._internalIterator.hasNext()) { String entry = this._internalIterator.next(); FTPFile temp = this.parser.parseFTPEntry(entry); tmpResults.add(temp); count--;
while (count > 0 && this._internalIterator.hasPrevious()) { String entry = this._internalIterator.previous(); FTPFile temp = this.parser.parseFTPEntry(entry); tmpResults.add(0,temp); count--;
while (count > 0 && this._internalIterator.hasPrevious()) { String entry = (String) this._internalIterator.previous(); FTPFile temp = this.parser.parseFTPEntry(entry); tmpResults.add(0,temp); count--;
final FTPFile f = parser.parseFTPEntry(line); if(null == f) { continue;