/** * Internal method for reading the input into the <code>entries</code> list. * After this method has completed, <code>entries</code> will contain a * collection of entries (as defined by * <code>FTPFileEntryParser.readNextEntry()</code>), but this may contain * various non-entry preliminary lines from the server output, duplicates, * and other data that will not be part of the final listing. * * @param stream The socket stream on which the input will be read. * @param encoding The encoding to use. * * @throws IOException * thrown on any failure to read the stream */ private void readStream(InputStream stream, String encoding) throws IOException { BufferedReader reader = new BufferedReader( new InputStreamReader(stream, Charsets.toCharset(encoding))); String line = this.parser.readNextEntry(reader); while (line != null) { this.entries.add(line); line = this.parser.readNextEntry(reader); } reader.close(); }
/** * internal method for reading the input into the <code>lines</code> vector. * * @param stream The socket stream on which the input will be read. * @param encoding The encoding to use. * * @exception IOException thrown on any failure to read the stream */ public void readStream(InputStream stream, String encoding) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(stream, encoding)); String line = this.parser.readNextEntry(reader); while (line != null) { this.lines.add(line); line = this.parser.readNextEntry(reader); } reader.close(); }
String line = this.parser.readNextEntry(reader); line = this.parser.readNextEntry(reader);
String line = this.parser.readNextEntry(reader); line = this.parser.readNextEntry(reader);