Fields Summary |
---|
public static final String | HEADER_ANDROID_ATTACHMENT_STORE_DATAApplication specific header that contains Store specific information about an attachment.
In IMAP this contains the IMAP BODYSTRUCTURE part id so that the ImapStore can later
retrieve the attachment at will from the server.
The info is recorded from this header on LocalStore.appendMessages and is put back
into the MIME data by LocalStore.fetch. |
public static final String | HEADER_CONTENT_TYPE |
public static final String | HEADER_CONTENT_TRANSFER_ENCODING |
public static final String | HEADER_CONTENT_DISPOSITION |
public static final String | HEADER_CONTENT_ID |
private static final String[] | writeOmitFieldsFields that should be omitted when writing the header using writeTo() |
protected ArrayList | mFields |
Methods Summary |
---|
public void | addHeader(java.lang.String name, java.lang.String value)
mFields.add(new Field(name, MimeUtility.foldAndEncode(value)));
|
public void | clear()
mFields.clear();
|
public java.lang.String | getFirstHeader(java.lang.String name)
String[] header = getHeader(name);
if (header == null) {
return null;
}
return header[0];
|
public java.lang.String[] | getHeader(java.lang.String name)
ArrayList<String> values = new ArrayList<String>();
for (Field field : mFields) {
if (field.name.equalsIgnoreCase(name)) {
values.add(field.value);
}
}
if (values.size() == 0) {
return null;
}
return values.toArray(new String[] {});
|
public void | removeHeader(java.lang.String name)
ArrayList<Field> removeFields = new ArrayList<Field>();
for (Field field : mFields) {
if (field.name.equalsIgnoreCase(name)) {
removeFields.add(field);
}
}
mFields.removeAll(removeFields);
|
public void | setHeader(java.lang.String name, java.lang.String value)
if (name == null || value == null) {
return;
}
removeHeader(name);
addHeader(name, value);
|
public void | writeTo(java.io.OutputStream out)
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out), 1024);
for (Field field : mFields) {
if (!Utility.arrayContains(writeOmitFields, field.name)) {
writer.write(field.name + ": " + field.value + "\r\n");
}
}
writer.flush();
|