/** * Return the message header and the first n lines of the message. */ synchronized InputStream top(int msg, int n) throws IOException { Response r = multilineCommand("TOP " + msg + " " + n, 0); return r.bytes; }
/** * Return the size of all messages using the LIST command. */ synchronized InputStream list() throws IOException { Response r = multilineCommand("LIST", 128); // 128 == output size est return r.bytes; }
/** * Return the size of all messages using the LIST command. */ synchronized InputStream list() throws IOException { Response r = multilineCommand("LIST", 128); // 128 == output size est return r.bytes; }
/** * Return the message header and the first n lines of the message. */ synchronized InputStream top(int msg, int n) throws IOException { Response r = multilineCommand("TOP " + msg + " " + n, 0); return r.bytes; }
/** * Get server capabilities using CAPA command specified by RFC 2449. * Returns null if not supported. */ synchronized InputStream capa() throws IOException { Response r = multilineCommand("CAPA", 128); // 128 == output size est if (!r.ok) return null; return r.bytes; }
/** * Get server capabilities using CAPA command specified by RFC 2449. * Returns null if not supported. */ synchronized InputStream capa() throws IOException { Response r = multilineCommand("CAPA", 128); // 128 == output size est if (!r.ok) return null; return r.bytes; }
/** * Return the UIDL strings for all messages. * The UID for msg #N is returned in uids[N-1]. */ synchronized boolean uidl(String[] uids) throws IOException { Response r = multilineCommand("UIDL", 15 * uids.length); if (!r.ok) return false; LineInputStream lis = new LineInputStream(r.bytes); String line = null; while ((line = lis.readLine()) != null) { int i = line.indexOf(' '); if (i < 1 || i >= line.length()) continue; int n = Integer.parseInt(line.substring(0, i)); if (n > 0 && n <= uids.length) uids[n - 1] = line.substring(i + 1); } try { r.bytes.close(); } catch (IOException ex) { // ignore it } return true; }
/** * Return the UIDL strings for all messages. * The UID for msg #N is returned in uids[N-1]. */ synchronized boolean uidl(String[] uids) throws IOException { Response r = multilineCommand("UIDL", 15 * uids.length); if (!r.ok) return false; LineInputStream lis = new LineInputStream(r.bytes); String line = null; while ((line = lis.readLine()) != null) { int i = line.indexOf(' '); if (i < 1 || i >= line.length()) continue; int n = Integer.parseInt(line.substring(0, i)); if (n > 0 && n <= uids.length) uids[n - 1] = line.substring(i + 1); } try { r.bytes.close(); } catch (IOException ex) { // ignore it } return true; }
/** * Return the message header and the first n lines of the message. */ synchronized InputStream top(int msg, int n) throws IOException { Response r = multilineCommand("TOP " + msg + " " + n, 0); return r.bytes; }
/** * Return the size of all messages using the LIST command. */ synchronized InputStream list() throws IOException { Response r = multilineCommand("LIST", 128); // 128 == output size est return r.bytes; }
/** * Return the size of all messages using the LIST command. */ synchronized InputStream list() throws IOException { Response r = multilineCommand("LIST", 128); // 128 == output size est return r.bytes; }
/** * Return the size of all messages using the LIST command. */ synchronized InputStream list() throws IOException { Response r = multilineCommand("LIST", 128); // 128 == output size est return r.bytes; }
/** * Return the size of all messages using the LIST command. */ synchronized InputStream list() throws IOException { Response r = multilineCommand("LIST", 128); // 128 == output size est return r.bytes; }
/** * Return the message header and the first n lines of the message. */ synchronized InputStream top(int msg, int n) throws IOException { Response r = multilineCommand("TOP " + msg + " " + n, 0); return r.bytes; }
/** * Return the message header and the first n lines of the message. */ synchronized InputStream top(int msg, int n) throws IOException { Response r = multilineCommand("TOP " + msg + " " + n, 0); return r.bytes; }
/** * Return the message header and the first n lines of the message. */ synchronized InputStream top(int msg, int n) throws IOException { Response r = multilineCommand("TOP " + msg + " " + n, 0); return r.bytes; }
/** * Get server capabilities using CAPA command specified by RFC 2449. * Returns null if not supported. */ synchronized InputStream capa() throws IOException { Response r = multilineCommand("CAPA", 128); // 128 == output size est if (!r.ok) return null; return r.bytes; }
/** * Return the size of all messages using the LIST command. */ synchronized InputStream list() throws IOException { Response r = multilineCommand("LIST", 128); // 128 == output size est return r.bytes; }
/** * Get server capabilities using CAPA command specified by RFC 2449. * Returns null if not supported. */ synchronized InputStream capa() throws IOException { Response r = multilineCommand("CAPA", 128); // 128 == output size est if (!r.ok) return null; return r.bytes; }
/** * Retrieve the specified message. * Given an estimate of the message's size we can be more efficient, * preallocating the array and returning a SharedInputStream to allow * us to share the array. */ synchronized InputStream retr(int msg, int size) throws IOException { Response r = multilineCommand("RETR " + msg, size); return r.bytes; }