Package org.apache.james.mime4j.storage
Class StorageTextBody
java.lang.Object
org.apache.james.mime4j.dom.SingleBody
org.apache.james.mime4j.dom.TextBody
org.apache.james.mime4j.storage.StorageTextBody
- All Implemented Interfaces:
Body
,Disposable
Text body backed by a
Storage
.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Returns a copy of thisSingleBody
(optional operation).void
dispose()
Deletes the Storage that holds the content of this text body.Gets aInputStream
which reads the bytes of the body.Returns the MIME charset of this text body.Gets aReader
which may be used to read out the contents of this body.Methods inherited from class org.apache.james.mime4j.dom.SingleBody
getParent, setParent, size, writeTo
-
Field Details
-
storage
-
charset
-
-
Constructor Details
-
StorageTextBody
-
-
Method Details
-
getMimeCharset
Description copied from class:TextBody
Returns the MIME charset of this text body.- Specified by:
getMimeCharset
in classTextBody
- Returns:
- the MIME charset.
-
getCharset
- Specified by:
getCharset
in classTextBody
-
getReader
Description copied from class:TextBody
Gets aReader
which may be used to read out the contents of this body.- Specified by:
getReader
in classTextBody
- Returns:
- the
Reader
. - Throws:
IOException
- on I/O errors.
-
getInputStream
Description copied from class:SingleBody
Gets aInputStream
which reads the bytes of the body.- Specified by:
getInputStream
in classSingleBody
- Returns:
- the stream, transfer decoded
- Throws:
IOException
- on I/O errors.
-
copy
Description copied from class:SingleBody
Returns a copy of thisSingleBody
(optional operation).The general contract of this method is as follows:
- Invoking
SingleBody.getParent()
on the copy returnsnull
. That means that the copy is detached from the parent entity of thisSingleBody
. The copy may get attached to a different entity later on. - The underlying content does not have to be copied. Instead it may be
shared between multiple copies of a
SingleBody
. - If the underlying content is shared by multiple copies the implementation has to make sure that the content gets deleted when the last copy gets disposed of (and not before that).
This implementation always throws an
UnsupportedOperationException
.- Overrides:
copy
in classSingleBody
- Returns:
- a copy of this
SingleBody
.
- Invoking
-
dispose
public void dispose()Deletes the Storage that holds the content of this text body.- Specified by:
dispose
in interfaceDisposable
- Overrides:
dispose
in classSingleBody
- See Also:
-