args.writeString(Integer.toString(start) + ":" + Integer.toString(end)); args.writeString("BODY[]"); Response[] r = protocol.command("FETCH", args); Response response = r[r.length - 1]; if (response.isOK()) { if (r[i] instanceof IMAPResponse) { fetch = (FetchResponse) r[i]; body = (BODY) fetch.getItem(0); is = body.getByteArrayInputStream(); try { mm = new MimeMessage(session, is); protocol.notifyResponseHandlers(r); protocol.handleResult(response);
public void storeFlags(MessageSet[] msgsets, Flags flags, boolean set) throws ProtocolException { storeFlags(MessageSet.toString(msgsets), flags, set); }
/** * Read a response from the server. * * @return the response * @exception IOException for I/O errors * @exception ProtocolException for protocol failures */ public Response readResponse() throws IOException, ProtocolException { // assert Thread.holdsLock(this); // can't assert because it's called from constructor IMAPResponse r = new IMAPResponse(this); if (r.keyEquals("FETCH")) r = new FetchResponse(r, getFetchItems()); return r; }
/** * Constructor. * * @param r the FetchResponse * @exception ParsingException for parsing failures */ public UID(FetchResponse r) throws ParsingException { seqnum = r.getNumber(); r.skipSpaces(); uid = r.readLong(); } }
/** * MOVE command. * * @param msgsets the messages to move * @param mbox the mailbox to move them to * @exception ProtocolException for protocol failures * @see "RFC 6851" * @since JavaMail 1.5.4 */ public void move(MessageSet[] msgsets, String mbox) throws ProtocolException { moveuid(MessageSet.toString(msgsets), mbox, false); }
public Object doCommand(IMAPProtocol p) throws ProtocolException { return p.listRights(fullName, name); } });
public Object doCommand(IMAPProtocol p) throws ProtocolException { p.setACL(fullName, mod, acl); return null; } });
public Object doCommand(IMAPProtocol p) throws ProtocolException { p.delete(fullName); return Boolean.TRUE; } });
public Object doCommand(IMAPProtocol p) throws ProtocolException { p.append(fullName, f, dd, mos); return null; } });
public Object doCommand(IMAPProtocol p) throws ProtocolException { return p.getACL(fullName); } });
/** * For testing. * * @param r the response string * @exception IOException for I/O errors * @exception ProtocolException for protocol failures */ public IMAPResponse(String r) throws IOException, ProtocolException { super(r); init(); }
public void storeFlags(MessageSet[] msgsets, Flags flags, boolean set) throws ProtocolException { storeFlags(MessageSet.toString(msgsets), flags, set); }
/** * MOVE command. * * @param msgsets the messages to move * @param mbox the mailbox to move them to * @exception ProtocolException for protocol failures * @see "RFC 6851" * @since JavaMail 1.5.4 */ public void move(MessageSet[] msgsets, String mbox) throws ProtocolException { moveuid(MessageSet.toString(msgsets), mbox, false); }
/** * COPY command, return uid from COPYUID response code. * * @param msgsets the messages to copy * @param mbox the mailbox to copy them to * @return COPYUID response data * @exception ProtocolException for protocol failures * @see "RFC 4315, section 3" */ public CopyUID copyuid(MessageSet[] msgsets, String mbox) throws ProtocolException { return copyuid(MessageSet.toString(msgsets), mbox, true); }
/** * COPY command, return uid from COPYUID response code. * * @param msgsets the messages to copy * @param mbox the mailbox to copy them to * @return COPYUID response data * @exception ProtocolException for protocol failures * @see "RFC 4315, section 3" */ public CopyUID copyuid(MessageSet[] msgsets, String mbox) throws ProtocolException { return copyuid(MessageSet.toString(msgsets), mbox, true); }