public class BodyPart extends Object implements Serializable, BodyPartInterface
Modifier and Type | Class and Description |
---|---|
class |
BodyPart.OffsetInputStream
The OffsetInputStream class is used to select a range of bytes from an
RACI and deliver those and only those bytes.
|
Modifier and Type | Field and Description |
---|---|
static String |
CLASS_NAME
This class name for this class.
|
Constructor and Description |
---|
BodyPart()
Constructs a BodyPart object.
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(BodyPart child)
Adds a child to this body part.
|
void |
addEncodedHeader(String name,
String value)
Adds a header to the body part.
|
void |
addHeader(String name,
String value)
Adds a header to the body part.
|
void |
contextIndex(boolean flag) |
void |
dump(String indent)
Dumps a formatted version of the body part to stdout.
|
InputStream |
getBodyStream()
Get an InputStream containing the body of this body part.
|
long |
getByteCount()
Get the number of bytes in this body part.
|
Reader |
getCleartextBodyReader()
Get a Reader containing the decoded body of this body part.
|
Reader |
getCleartextBodyReader(RandomAccessContentInterface raci)
Get a Reader containing the decoded body of this body part.
|
InputStream |
getCleartextBodyStream()
Get an InputStream containing the decoded body of this body part.
|
InputStream |
getCleartextBodyStream(RandomAccessContentInterface raci)
Get an InputStream containing the decoded body of this body part.
|
InputStream |
getContentStream()
Get an InputStream containing this body part.
|
String |
getContentType()
Get the MIME content type/subtype
|
boolean |
getContextIndex() |
Dictionary |
getEncodedHeaderDictionary()
Get a Dictionary containing the headers of this body part indexed by header name.
|
String |
getEncoding()
Get the content transfer encoding of this body part
|
Dictionary |
getHeaderDictionary()
Get a Dictionary containing the headers of this body part indexed by header name.
|
InputStream |
getHeaderStream()
Get an InputStream containing the header of this body part.
|
void |
getIndexableReaders(Vector readerVector,
RandomAccessContentInterface raci) |
InputStream |
getInputStream()
Get an InputStream containing this body part.
|
long |
getLineCount()
Get the number of lines in this body part.
|
String |
getName()
Get the name of this body part.
|
OutputStream |
getOutputStream()
Throws an exception.
|
PublicObjectInterface |
getPublicObject()
Get a PublicObject representing the content of this BodyPart
|
Vector |
getSubParts()
Get a Vector containing the child body parts of this body part.
|
void |
setBodyOffset(long offset)
Store the offset in the message of the body of this BodyPart
|
void |
setByteCount(long byteCount)
Store the number of bytes in this BodyPart
|
void |
setCharset(String charSet)
Set the character set of this body part.
|
void |
setContentSubtype(String contentSubtype)
Store the content subtype of this body part
|
void |
setContentType(String contentType)
Store the content type of this body part
|
void |
setEncoding(String encoding)
Set the content transfer encoding of this body part.
|
void |
setEndOffset(long offset)
Store the offset in the message of the end of this BodyPart
|
void |
setHeaderOffset(long offset)
Store the offset in the message of the header of this BodyPart
|
void |
setLineCount(long lineCount)
Store the number of lines in this BodyPart
|
void |
setMsg(Document msg) |
void |
updateByteCount() |
public static final String CLASS_NAME
public BodyPart()
public void addHeader(String name, String value)
name
- the name of the headervalue
- the value of the headerpublic void addEncodedHeader(String name, String value)
name
- the name of the headervalue
- the value of the header is the original encoded valuepublic void addChild(BodyPart child)
child
- The child BodyPart to be added.public void setMsg(Document msg)
public void setHeaderOffset(long offset)
offset
- The offset in the message of the header of this BodyPartpublic void setBodyOffset(long offset)
offset
- The offset in the message of the body of this BodyPartpublic void setEndOffset(long offset)
offset
- The offset in the message of the end of this BodyPartpublic void setByteCount(long byteCount)
byteCount
- The number of bytes in this BodyPartpublic void setLineCount(long lineCount)
lineCount
- The number of lines in this BodyPartpublic void setContentType(String contentType)
contentType
- The MIME content type of this body part.public void setContentSubtype(String contentSubtype)
contentSubtype
- The MIME content subtype of this body part.public void setEncoding(String encoding)
encoding
- public void setCharset(String charSet)
charSet
- public Dictionary getHeaderDictionary()
getHeaderDictionary
in interface BodyPartInterface
public Dictionary getEncodedHeaderDictionary()
public long getLineCount()
getLineCount
in interface BodyPartInterface
public long getByteCount()
getByteCount
in interface BodyPartInterface
public InputStream getCleartextBodyStream(RandomAccessContentInterface raci) throws IOException, IfsException
IOException
IfsException
public InputStream getCleartextBodyStream() throws IOException, IfsException
getCleartextBodyStream
in interface BodyPartInterface
IOException
IfsException
public Reader getCleartextBodyReader(RandomAccessContentInterface raci) throws IOException, IfsException, UnsupportedEncodingException
IOException
IfsException
UnsupportedEncodingException
public Reader getCleartextBodyReader() throws IOException, IfsException, UnsupportedEncodingException
IOException
IfsException
UnsupportedEncodingException
public Vector getSubParts()
getSubParts
in interface BodyPartInterface
public String getEncoding()
getEncoding
in interface BodyPartInterface
public String getContentType()
getContentType
in interface BodyPartInterface
public InputStream getBodyStream() throws IOException, IfsException
getBodyStream
in interface BodyPartInterface
IOException
IfsException
public void updateByteCount() throws IOException, IfsException
IOException
IfsException
public InputStream getHeaderStream() throws IOException, IfsException
getHeaderStream
in interface BodyPartInterface
IOException
IfsException
public InputStream getInputStream() throws IOException
IOException
public OutputStream getOutputStream() throws IOException
IOException
public String getName()
public InputStream getContentStream() throws IOException, IfsException
getContentStream
in interface BodyPartInterface
IOException
IfsException
public void contextIndex(boolean flag)
public boolean getContextIndex()
public PublicObjectInterface getPublicObject() throws IfsException
IfsException
public void dump(String indent) throws IOException, IfsException
indent
- The string to print before each line of the formatted output.IOException
IfsException
public void getIndexableReaders(Vector readerVector, RandomAccessContentInterface raci) throws IOException, IfsException
IOException
IfsException
Copyright © 2023. All rights reserved.