本文整理匯總了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);
}