本文整理汇总了Java中org.apache.james.mime4j.message.MultipartImpl类的典型用法代码示例。如果您正苦于以下问题:Java MultipartImpl类的具体用法?Java MultipartImpl怎么用?Java MultipartImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MultipartImpl类属于org.apache.james.mime4j.message包,在下文中一共展示了MultipartImpl类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeToFirstSingleBody
import org.apache.james.mime4j.message.MultipartImpl; //导入依赖的package包/类
private boolean writeToFirstSingleBody(Disposable body, OutputStream out) throws IOException {
if(body instanceof SingleBody) {
((SingleBody) body).writeTo(out);
return true;
}
if(body instanceof MultipartImpl) {
for(Entity childBody : ((MultipartImpl) body).getBodyParts()) {
if(writeToFirstSingleBody(childBody, out)) {
return true;
}
}
}
if(body instanceof BodyPart) {
return writeToFirstSingleBody(((BodyPart) body).getBody(), out);
}
return false;
}
示例2: startMultipart
import org.apache.james.mime4j.message.MultipartImpl; //导入依赖的package包/类
/**
* @see org.apache.james.mime4j.parser.ContentHandler#startMultipart(org.apache.james.mime4j.stream.BodyDescriptor)
*/
public void startMultipart(final BodyDescriptor bd) throws MimeException {
expect(Entity.class);
final Entity e = (Entity) stack.peek();
final String subType = bd.getSubType();
final Multipart multiPart = new MultipartImpl(subType);
e.setBody(multiPart);
stack.push(multiPart);
}
示例3: multipartReport
import org.apache.james.mime4j.message.MultipartImpl; //导入依赖的package包/类
private Multipart multipartReport() {
Multipart result = new MultipartImpl("report");
result.addBodyPart(humanReadableTextBodyPart());
result.addBodyPart(deliveryStatusBodyPart());
result.addBodyPart(originalMessageBodyPart());
return result;
}
示例4: epilogue
import org.apache.james.mime4j.message.MultipartImpl; //导入依赖的package包/类
/**
* @see org.apache.james.mime4j.parser.ContentHandler#epilogue(java.io.InputStream)
*/
public void epilogue(InputStream is) throws MimeException, IOException {
expect(MultipartImpl.class);
ByteSequence bytes = loadStream(is);
((MultipartImpl) stack.peek()).setEpilogueRaw(bytes);
}
示例5: preamble
import org.apache.james.mime4j.message.MultipartImpl; //导入依赖的package包/类
/**
* @see org.apache.james.mime4j.parser.ContentHandler#preamble(java.io.InputStream)
*/
public void preamble(InputStream is) throws MimeException, IOException {
expect(MultipartImpl.class);
ByteSequence bytes = loadStream(is);
((MultipartImpl) stack.peek()).setPreambleRaw(bytes);
}