/** * handle the initial reading and preparsing of the list returned by * the server. After this method has completed, this object will contain * a list of unparsed entries (Strings) each referring to a unique file * on the server. * * @param stream input stream provided by the server socket. * @param encoding the encoding to be used for reading the stream * * @throws IOException * thrown on any failure to read from the sever. */ public void readServerList(InputStream stream, String encoding) throws IOException { this.entries = new LinkedList<String>(); readStream(stream, encoding); this.parser.preParse(this.entries); resetIterator(); }
@Override public List<String> preParse(final List<String> original) { for(FTPFileEntryParser parser : parsers) { parser.preParse(original); } return original; }
/** * handle the iniitial reading and preparsing of the list returned by * the server. After this method has completed, this object will contain * a list of unparsed entries (Strings) each referring to a unique file * on the server. * * @param stream input stream provided by the server socket. * * @exception IOException * thrown on any failure to read from the sever. */ public void readServerList(InputStream stream, String encoding) throws IOException { this.entries = new LinkedList(); readStream(stream, encoding); this.parser.preParse(this.entries); resetIterator(); }
/** * handle the iniitial reading and preparsing of the list returned by * the server. After this method has completed, this object will contain * a list of unparsed entries (Strings) each referring to a unique file * on the server. * * @param stream input stream provided by the server socket. * * @exception IOException * thrown on any failure to read from the sever. */ public void readServerList(InputStream stream, String encoding) throws IOException { this.entries = new LinkedList<String>(); readStream(stream, encoding); this.parser.preParse(this.entries); resetIterator(); }
/** * The only way to create an <code>FTPFileList</code> object. Invokes * the private constructor and then reads the stream supplied stream to * build the intermediate array of "lines" which will later be parsed * into <code>FTPFile</code> object. * * @param stream The input stream created by reading the socket on which * the output of the LIST command was returned * @param parser the default <code>FTPFileEntryParser</code> to be used * by this object. This may later be changed using the init() method. * @param encoding The encoding to use * * @return the <code>FTPFileList</code> created, with an initialized * of unparsed lines of output. Will be null if the listing cannot * be read from the stream. * @exception IOException * Thrown on any failure to read from the socket. */ public static FTPFileList create(InputStream stream, FTPFileEntryParser parser, String encoding) throws IOException { FTPFileList list = new FTPFileList(parser, encoding); list.readStream(stream, encoding); parser.preParse(list.lines); return list; }
parser.preParse(replies); for(String line : replies) { final FTPFile f = parser.parseFTPEntry(line);