@Override public void removeAllAttachments() { try { initializeAllAttachments(); } catch (Exception e) { throw new RuntimeException(e); } if (attachments != null) { attachments.clear(); needsSave(); } }
public MimeMatchingIterator(MimeHeaders headers) { this.headers = headers; this.iter = attachments.iterator(); }
@Override public int size() { return headers.size(); } };
FinalArrayList<String> v = new FinalArrayList<String>(); if (tkType == HeaderTokenizer.Token.EOF) break; // done else if (tkType == HeaderTokenizer.Token.ATOM) v.add(tk.getValue()); else // invalid token, skip it. continue; return null; return v.toArray(new String[v.size()]);
/** * Add a header with the specified name and value to the header list. * Note that RFC822 headers can only contain US-ASCII characters. * * @param name header name * @param value header value */ public void addHeader(String name, String value) { int pos = headers.size(); for (int i = headers.size() - 1; i >= 0; i--) { hdr h = headers.get(i); if (name.equalsIgnoreCase(h.name)) { headers.add(i + 1, new hdr(name, value)); return; } // marker for default place to add new headers if (h.name.equals(":")) pos = i; } headers.add(pos, new hdr(name, value)); }
return (null); return v.toArray(new String[v.size()]);
/** * Add an RFC822 header line to the header store. * If the line starts with a space or tab (a continuation line), * add it to the last header line in the list. * <p> * Note that RFC822 headers can only contain US-ASCII characters * * @param line raw RFC822 header line */ public void addHeaderLine(String line) { try { char c = line.charAt(0); if (c == ' ' || c == '\t') { hdr h = headers.get(headers.size() - 1); h.line += "\r\n" + line; } else headers.add(new hdr(line)); } catch (StringIndexOutOfBoundsException e) { // line is empty, ignore it return; } catch (NoSuchElementException e) { // XXX - vector is empty? } }
for (int i = 0; i < parts.size(); i++) {