本文整理了Java中org.apache.james.mime4j.stream.Field.getRaw()
方法的一些代码示例,展示了Field.getRaw()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Field.getRaw()
方法的具体详情如下:
包路径:org.apache.james.mime4j.stream.Field
类名称:Field
方法名:getRaw
[英]Gets original (raw) representation of the field, if available, null
otherwise.
[中]获取字段的原始(原始)表示形式(如果可用),否则为null
。
代码示例来源:origin: k9mail/k-9
@Override
public void field(Field rawField) throws MimeException {
String name = rawField.getName();
String raw = rawField.getRaw().toString();
part.addRawHeader(name, raw);
}
代码示例来源:origin: k9mail/k-9
@Override
public void field(Field parsedField) throws MimeException {
expect(Part.class);
String name = parsedField.getName();
String raw = parsedField.getRaw().toString();
((Part) stack.peek()).addRawHeader(name, raw);
}
}
代码示例来源:origin: k9mail/k-9
@Override
public void field(Field parsedField) throws MimeException {
String name = parsedField.getName();
String raw = parsedField.getRaw().toString();
Part part = (Part) stack.peek();
part.addRawHeader(name, raw);
String fieldImmediateValue = MimeUtility.getHeaderParameter(parsedField.getBody(), null);
if ("Content-Type".equalsIgnoreCase(name) && MimeUtility.isMessage(fieldImmediateValue)) {
isMessagePart = true;
}
if ("Content-Disposition".equalsIgnoreCase(name) && "attachment".equalsIgnoreCase(fieldImmediateValue)) {
isContentDispositionAttachment = true;
}
}
代码示例来源:origin: apache/tika
private String stripOutFieldPrefix(Field field, String fieldname) {
String temp = field.getRaw().toString();
int loc = fieldname.length();
while (temp.charAt(loc) == ' ') {
loc++;
}
return temp.substring(loc);
}
代码示例来源:origin: org.apache.james/apache-mime4j-dom
/**
* Gets original (raw) representation of the field, if available,
* <code>null</code> otherwise.
*/
public ByteSequence getRaw() {
return rawField.getRaw();
}
代码示例来源:origin: org.apache.tika/tika-parsers
private String stripOutFieldPrefix(Field field, String fieldname) {
String temp = field.getRaw().toString();
int loc = fieldname.length();
while (temp.charAt(loc) == ' ') {
loc++;
}
return temp.substring(loc);
}
代码示例来源:origin: com.github.lafa.tikaNoExternal/tika-parsers
private String stripOutFieldPrefix(Field field, String fieldname) {
String temp = field.getRaw().toString();
int loc = fieldname.length();
while (temp.charAt(loc) == ' ') {
loc++;
}
return temp.substring(loc);
}
代码示例来源:origin: org.apache.james/apache-mime4j-dom
/**
* Write the specified <code>Field</code> to the specified
* <code>OutputStream</code>.
*
* @param field
* the <code>Field</code> to write.
* @param out
* the OutputStream to write to.
* @throws IOException
* if an I/O error occurs.
*/
public void writeField(Field field, OutputStream out) throws IOException {
ByteSequence raw = field.getRaw();
if (raw == null) {
StringBuilder buf = new StringBuilder();
buf.append(field.getName());
buf.append(": ");
String body = field.getBody();
if (body != null) {
buf.append(body);
}
raw = ContentUtil.encode(MimeUtil.fold(buf.toString(), 0));
}
writeBytes(raw, out);
out.write(CRLF);
}
代码示例来源:origin: org.apache.james/apache-james-mailbox-store
@Override
public void field(Field field) throws MimeException {
String fieldValue;
if (field instanceof RawField) {
// check if we can access the body in the raw form so no unfolding was done under the hood
ByteSequence raw = field.getRaw();
int len = raw.length();
int off = ((RawField) field).getDelimiterIdx() + 1;
if (len > off + 1 && (raw.byteAt(off) & 0xff) == 0x20) {
off++;
}
fieldValue = ContentUtil.decode(raw, off, len - off);
} else {
fieldValue = field.getBody();
}
if (fieldValue.endsWith("\r\f")) {
fieldValue = fieldValue.substring(0,fieldValue.length() - 2);
}
if (fieldValue.startsWith(" ")) {
fieldValue = fieldValue.substring(1);
}
final ResultHeader resultHeader = new ResultHeader(field.getName(), fieldValue);
results.add(resultHeader);
}
});
内容来源于网络,如有侵权,请联系作者删除!