public void parse(InputStream is) throws IOException { mimeMessage = new BinaryMessage(addHeaderToHeadlessStream(is)); extractParts(); }
public void writeTo(Object t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException { MultipartRelatedOutput xopPackage = new MultipartRelatedOutput(); XopWithMultipartRelatedJAXBProvider xopWithMultipartRelatedJAXBProvider = new XopWithMultipartRelatedJAXBProvider( workers); xopWithMultipartRelatedJAXBProvider.writeTo(t, type, genericType, annotations, mediaType, httpHeaders, xopPackage); writeRelated(xopPackage, mediaType, httpHeaders, entityStream); }
/** * @param contentID * the RFC2045 compliant Content-ID * @return the RFC2392 compliant cid representing the contentID */ public static String convertContentIDToCid(String contentID) { return generateCidFromAddrSpec(parseAddrSpecFromContentID(contentID)); } }
public OutputPart addFormData(String key, Object entity, MediaType mediaType, String filename) { OutputPart part = super.addPart(entity, mediaType, filename); formData.put(key, part); addFormDataMap(key, part); return part; }
/** * @param cid * the RFC2392 compliant cid * @return the RFC2045 compliant Content-ID representing the cid */ public static String convertCidToContentID(String cid) { return generateContentIDFromAddrSpec(parseAddrSpecFromCid(cid)); }
/** * Calls {@link #generateContentIDFromAddrSpec(String)} with * {@link #generateRFC822AddrSpec()} as parameter. * * @return the generated Content-ID */ public static String generateContentID() { return generateContentIDFromAddrSpec(generateRFC822AddrSpec()); }
@Override public DataHandler getAttachmentAsDataHandler(final String cid) { final InputPart inputPart = getInputPart(cid); return new DataHandler( new InputPartBackedDataSource(cid, inputPart)); }
protected void writeParts(MultipartOutput multipartOutput, OutputStream entityStream, byte[] boundaryBytes) throws IOException { for (OutputPart part : multipartOutput.getParts()) { MultivaluedMap<String, Object> headers = new MultivaluedMapImpl<String, Object>(); writePart(entityStream, boundaryBytes, part, headers); } }
private BinaryOnlyMessageBuilder(final Entity entity) { super(entity); init(); }
private MediaType getMediaTypeWithDefaultCharset(MediaType mediaType) { String charset = defaultPartCharset; return getMediaTypeWithCharset(mediaType, charset); }
public MultipartInputImpl(final MediaType contentType, final Providers workers, final MediaType defaultPartContentType, final String defaultPartCharset) { this.contentType = contentType; this.workers = workers; if (defaultPartContentType != null) this.defaultPartContentType = defaultPartContentType; this.defaultPartCharset = defaultPartCharset; if (defaultPartCharset != null) { this.defaultPartContentType = getMediaTypeWithDefaultCharset(this.defaultPartContentType); } }
public void writeTo(MultipartRelatedOutput multipartRelatedOutput, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException { writeRelated(multipartRelatedOutput, mediaType, httpHeaders, entityStream); }
@Override protected Storage toStorage0() throws IOException { // out has already been closed because toStorage calls close return new TempFileStorage(file); } }
protected void finalize() throws Throwable { close(); } }
public void writeTo(MultipartOutput multipartOutput, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException { write(multipartOutput, mediaType, httpHeaders, entityStream); }
public OutputPart addFormData(String key, Object entity, Class<?> type, Type genericType, MediaType mediaType) { OutputPart part = super.addPart(entity, type, genericType, mediaType); formData.put(key, part); addFormDataMap(key, part); return part; }
private BinaryOnlyMessageBuilder(final Entity entity, final StorageProvider storageProvider) { super(entity, storageProvider); init(); }
public OutputPart addFormData(String key, Object entity, Class<?> type, Type genericType, MediaType mediaType, String filename) { OutputPart part = super.addPart(entity, type, genericType, mediaType, filename); formData.put(key, part); addFormDataMap(key, part); return part; }
public OutputPart addFormData(String key, Object entity, GenericType<?> type, MediaType mediaType) { OutputPart part = super.addPart(entity, type, mediaType); formData.put(key, part); addFormDataMap(key, part); return part; }
public OutputPart addFormData(String key, Object entity, GenericType<?> type, MediaType mediaType, String filename) { OutputPart part = super.addPart(entity, type, mediaType, filename); formData.put(key, part); addFormDataMap(key, part); return part; }