public class Attachment
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BUFFER_SIZE |
Constructor and Description |
---|
Attachment(java.lang.String ctype,
java.lang.String cid) |
Attachment(java.lang.String ctype,
java.lang.String cid,
org.jdom.Document doc) |
Attachment(java.lang.String ctype,
java.lang.String cid,
java.io.InputStream is) |
Attachment(java.lang.String ctype,
java.lang.String cid,
java.lang.String url,
org.apache.http.client.CredentialsProvider creds) |
Attachment(java.lang.String ctype,
java.lang.String cid,
java.lang.String datasetId,
org.jdom.Document besCmd) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getContentType() |
java.lang.String |
getHeader(java.lang.String name) |
void |
setHeader(java.lang.String name,
java.lang.String value) |
void |
write(java.lang.String mimeBoundary,
javax.servlet.ServletOutputStream sos)
Write the attchment to the indicated stream
|
public static final int DEFAULT_BUFFER_SIZE
public Attachment(java.lang.String ctype, java.lang.String cid)
public Attachment(java.lang.String ctype, java.lang.String cid, java.io.InputStream is)
ctype
- String containing the value of the HTTP header Content-Type for this attachment.cid
- String containing the value if the HTTP header Content-Id for this attachment.is
- A stream containing the content for this attachment.public Attachment(java.lang.String ctype, java.lang.String cid, java.lang.String url, org.apache.http.client.CredentialsProvider creds)
ctype
- String containing the value of the HTTP header Content-Type for this attachment.cid
- String containing the value if the HTTP header Content-Id for this attachment.url
- A URL that when dereferenced will provide the content for this attachment.public Attachment(java.lang.String ctype, java.lang.String cid, java.lang.String datasetId, org.jdom.Document besCmd)
ctype
- String containing the value of the HTTP header Content-Type for this attachment.cid
- String containing the value if the HTTP header Content-Id for this attachment.datasetId
- The unique ID for the dataset in the BESbesCmd
- The BES command to execute in order to transmit the attachment.public Attachment(java.lang.String ctype, java.lang.String cid, org.jdom.Document doc)
ctype
- String containing the value of the HTTP header Content-Type for this attachment.cid
- String containing the value if the HTTP header Content-Id for this attachment.doc
- A JDOM XML document to provide the content for this attachment.public void setHeader(java.lang.String name, java.lang.String value)
public java.lang.String getHeader(java.lang.String name)
public java.lang.String getContentType()
public void write(java.lang.String mimeBoundary, javax.servlet.ServletOutputStream sos) throws java.io.IOException, java.net.URISyntaxException, PPTException, BadConfigurationException, BESError
mimeBoundary
- MIME Boundary for the attachment.sos
- Stream to which to write the attachment.java.io.IOException
- When things can't be read or written.java.net.URISyntaxException
- If the target URL is hosed.PPTException
BadConfigurationException
BESError