public class DefaultAttachmentFactory extends AttachmentFactory
| Modifier and Type | Field and Description |
|---|---|
static char |
CONTENT_TYPE_SEPARATOR |
| Constructor and Description |
|---|
DefaultAttachmentFactory()
Constructor for a new default attachment factory.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addStreamingMediaType(ContentType type)
Add a streaming mediatype.
|
OutgoingAttachment |
createFileAttachment(java.lang.String absoluteFilename,
ContentType contentType)
Creates a new FileAttachment.
|
OutgoingAttachment |
createFileAttachment(java.lang.String absoluteFilename,
java.lang.String contentId,
ContentType contentType)
Creates a new FileAttachment.
|
OutgoingAttachment |
createMemoryAttachment(byte[] bytes,
ContentType contentType)
Creates a new MemoryAttachment.
|
OutgoingAttachment |
createMemoryAttachment(byte[] bytes,
java.lang.String contentId,
ContentType contentType)
Creates a new MemoryAttachment.
|
OutgoingOutputStreamAttachment |
createStreamAttachment(ContentType contentType)
Creates a new OutgoingOutputStreamAttachment.
|
OutgoingAttachment |
createStreamAttachment(java.io.InputStream in,
ContentType contentType)
Creates a new OutgoingInputStreamAttachment.
|
OutgoingAttachment |
createStreamAttachment(java.io.InputStream in,
java.lang.String contentId,
ContentType contentType)
Creates a new OutgoingInputStreamAttachment.
|
OutgoingOutputStreamAttachment |
createStreamAttachment(java.lang.String contentId,
ContentType contentType)
Creates a new OutgoingOutputStreamAttachment.
|
Iterator |
getStreamingMediaTypes()
Returns an iterator over all streaming mediatypes.
|
boolean |
isStreamingMediaType(ContentType type)
Returns true if type is streaming mediatype.
|
boolean |
removeStreamingMediaType(ContentType type)
Removes a streaming mediatype.
|
void |
resetStreamingMediaTypes()
Reseted all streaming media types.
|
getInstancepublic static final char CONTENT_TYPE_SEPARATOR
public DefaultAttachmentFactory()
public boolean addStreamingMediaType(ContentType type)
AttachmentFactoryaddStreamingMediaType in class AttachmentFactorypublic boolean removeStreamingMediaType(ContentType type)
AttachmentFactoryremoveStreamingMediaType in class AttachmentFactorypublic boolean isStreamingMediaType(ContentType type)
AttachmentFactoryisStreamingMediaType in class AttachmentFactorypublic Iterator getStreamingMediaTypes()
AttachmentFactorygetStreamingMediaTypes in class AttachmentFactorypublic void resetStreamingMediaTypes()
AttachmentFactoryresetStreamingMediaTypes in class AttachmentFactorypublic OutgoingAttachment createFileAttachment(java.lang.String absoluteFilename, ContentType contentType)
AttachmentFactorycreateFileAttachment in class AttachmentFactorypublic OutgoingAttachment createFileAttachment(java.lang.String absoluteFilename, java.lang.String contentId, ContentType contentType)
AttachmentFactorycreateFileAttachment in class AttachmentFactorypublic OutgoingAttachment createMemoryAttachment(byte[] bytes, ContentType contentType)
AttachmentFactorycreateMemoryAttachment in class AttachmentFactorypublic OutgoingAttachment createMemoryAttachment(byte[] bytes, java.lang.String contentId, ContentType contentType)
AttachmentFactorycreateMemoryAttachment in class AttachmentFactorypublic OutgoingAttachment createStreamAttachment(java.io.InputStream in, ContentType contentType)
AttachmentFactorycreateStreamAttachment in class AttachmentFactorypublic OutgoingAttachment createStreamAttachment(java.io.InputStream in, java.lang.String contentId, ContentType contentType)
AttachmentFactorycreateStreamAttachment in class AttachmentFactorypublic OutgoingOutputStreamAttachment createStreamAttachment(ContentType contentType)
AttachmentFactorycreateStreamAttachment in class AttachmentFactorypublic OutgoingOutputStreamAttachment createStreamAttachment(java.lang.String contentId, ContentType contentType)
AttachmentFactorycreateStreamAttachment in class AttachmentFactory