public MediaBodyPart(InternetHeaders headers, byte [] content) throws MessagingException { super(headers, content); // javax.mail.util.SharedByteArrayInputStream here. String contentType = getContentType(); MediaStreamSource mediaStreamSource = new MediaStreamSource(new ByteArrayInputStream(content), contentType); String etag = getHeader(GDataProtocol.Header.ETAG, null); if (etag != null) { mediaStreamSource.setEtag(etag); } mediaSource = mediaStreamSource; initMediaDataHandler(); }
public MediaBodyPart(InternetHeaders headers, byte [] content) throws MessagingException { super(headers, content); // javax.mail.util.SharedByteArrayInputStream here. String contentType = getContentType(); MediaStreamSource mediaStreamSource = new MediaStreamSource(new ByteArrayInputStream(content), contentType); String etag = getHeader(GDataProtocol.Header.ETAG, null); if (etag != null) { mediaStreamSource.setEtag(etag); } mediaSource = mediaStreamSource; initMediaDataHandler(); }
public MediaBodyPart(InputStream is) throws MessagingException { // Process the headers from the input stream super(new InternetHeaders(is), null); // Create a media stream source to read the remaining data, using the // content type information from the headers. mediaSource = new MediaStreamSource(is, getContentType()); initMediaDataHandler(); }
public MediaBodyPart(InputStream is) throws MessagingException { // Process the headers from the input stream super(new InternetHeaders(is), null); // Create a media stream source to read the remaining data, using the // content type information from the headers. mediaSource = new MediaStreamSource(is, getContentType()); initMediaDataHandler(); }
public MediaBodyPart(MediaSource mediaSource) throws MessagingException { super(); this.mediaSource = mediaSource; //headers.setHeader("Content-Type", mediaSource.getContentType()); setHeader("Content-Type", mediaSource.getContentType()); String etag = mediaSource.getEtag(); if (etag != null) { setHeader(GDataProtocol.Header.ETAG, etag); } initMediaDataHandler(); }
public MediaBodyPart(MediaSource mediaSource) throws MessagingException { super(); this.mediaSource = mediaSource; //headers.setHeader("Content-Type", mediaSource.getContentType()); setHeader("Content-Type", mediaSource.getContentType()); String etag = mediaSource.getEtag(); if (etag != null) { setHeader(GDataProtocol.Header.ETAG, etag); } initMediaDataHandler(); }