public class NSFMimeItem extends NSFItem
Constructor and Description |
---|
NSFMimeItem(NSFNote parent,
String name,
BLOCKID itemBlockId,
ValueType dataType,
BLOCKID valueBlockId,
int valueLen)
Constructs a new
NSFMIMEItem object for the provided note and item name. |
Modifier and Type | Method and Description |
---|---|
String |
getDataAsString()
This method will return the body of the MIME entity as a String, using the in-header encoding
if present and UTF-8 otherwise.
|
byte[] |
getDataBytes()
This method will return the data as a byte array.
|
InputStream |
getInputStream()
This method will return an
InputStream of the MIME part's data. |
MIME_PART |
getMimePart()
Returns the value of this item as a
MIME_PART struct. |
addFlag, doFree, getDupItemId, getFlags, getItemBlockId, getName, getParent, getSeqByte, getType, getValue, getValue, getValueBlockId, getValueLen, isRefValid, removeFlag, setFlags, toString
_checkRefValidity, addChild, addChildStruct, debugPrintChildHierarchy, finalize, free, free, free, getAPI, getChildObjectCount, getChildObjectCount, getChildStructCount, isFreed, isTraceCreation, removeChild, removeChildStruct, removeFromParent, retain, setNeedsFree, setTraceCreation
public NSFMimeItem(NSFNote parent, String name, BLOCKID itemBlockId, ValueType dataType, BLOCKID valueBlockId, int valueLen)
NSFMIMEItem
object for the provided note and item name. The item will be the
first item in the note with the provided name.parent
- the NSFNote
containing the itemitemName
- the name of the itemitemBlockId
- the itemBlockId
returned by NSFItemInfo
dataType
- the ValueType
enum corresponding to the type returned by NSFItemInfo
valueBlockId
- the valueBlockId
returned by NSFItemInfo
valueLen
- the valueLen
returned by NSFItemInfo
public MIME_PART getMimePart() throws DominoException
MIME_PART
struct. It is the responsibility of the caller
to free this struct when done with it.DominoException
public byte[] getDataBytes() throws DominoException, IOException
Note that this will return the data from a referenced attachment if applicable, which could create a very large byte array in memory.
DominoException
IOException
- if the MIME item is backed by an attachment and there is a problem extracting
the attachment dataIllegalStateException
- if the MIME_PART indicates that its data is in a DB object,
but lacks information to retrieve itpublic InputStream getInputStream() throws DominoException, IOException
InputStream
of the MIME part's data.
Note that this may be backed by a temporary file in the case of attachment-stored MIME data. If it is, closing the input stream will delete the file.
DominoException
IOException
- if the MIME item is backed by an attachment and there is a problem extracting
the attachment dataIllegalStateException
- if the MIME_PART indicates that its data is in a DB object,
but lacks information to retrieve itpublic String getDataAsString() throws DominoException, IOException
IOException
- if the MIME item is backed by an attachment and there is a problem extracting
the attachment dataDominoException
Copyright © 2014–2018. All rights reserved.