public static class KVPDoc.KVPart extends java.lang.Object implements DocumentPart
Constructor and Description |
---|
KVPart() |
KVPart(java.lang.String filename,
java.lang.String mime,
byte[] bytes) |
Modifier and Type | Method and Description |
---|---|
void |
addCustomDirective(java.lang.String key,
java.lang.String value)
Add a custom directive
|
java.lang.String |
getComputedMime()
This is only available after MIME detection: TODO: maybe only in
AnalysisDocumentPart ??
|
java.nio.ByteBuffer |
getContentAsByteBuffer()
Create a new java.nio ByteBuffer containing the part's data
|
byte[] |
getContentAsBytes()
Get the part content as bytes.
|
java.io.InputStream |
getContentAsInputStream()
Get the part content as an input stream.
|
long |
getContentLength()
Get the part content length, in bytes.
|
java.util.List<Directive> |
getCustomDirectives()
Get the list of custom directives
|
java.lang.String |
getEncoding()
Get the encoding
|
java.lang.String |
getEncodingHint()
Get the encoding hint (encoding which may be the actual encoding)
|
java.lang.String |
getFilename()
Get the filename hint of the document part.
If it can be known, it's always better to specify a filename, as it helps some processing elements understand the type of the part. |
java.lang.String |
getForcedMime()
Get the forced MIME type (MIME type known to be valid, or enforced)
|
java.lang.String |
getMimeHint()
Get the MIME hint (MIME which may be the valid MIME)
|
java.lang.String |
getName()
Get the name of this part.
|
void |
setContent(byte[] bytes)
Set the content of this part, as a Java array
|
void |
setContent(java.nio.ByteBuffer buffer)
Set the content of this part, as a Java NIO ByteBuffer
|
void |
setContent(java.io.InputStream stream,
long streamSize)
Set the content of this part, as a Java InputStream
|
void |
setEncoding(java.lang.String encoding)
Set the encoding
|
void |
setEncodingHint(java.lang.String encodingHint)
Set the encoding hint (encoding which may be the actual encoding)
|
void |
setFilename(java.lang.String filename) |
void |
setForcedMime(java.lang.String forcedMime)
Set the forced MIME type (MIME type known to be valid, or enforced)
|
void |
setMimeHint(java.lang.String mimeHint)
Set the MIME hint (MIME which may be the valid MIME)
|
void |
setName(java.lang.String name) |
public KVPart()
public KVPart(java.lang.String filename, java.lang.String mime, byte[] bytes)
public java.lang.String getComputedMime()
DocumentPart
getComputedMime
in interface DocumentPart
public java.nio.ByteBuffer getContentAsByteBuffer()
DocumentPart
getContentAsByteBuffer
in interface DocumentPart
public byte[] getContentAsBytes()
DocumentPart
getContentAsBytes
in interface DocumentPart
public java.io.InputStream getContentAsInputStream()
DocumentPart
getContentAsInputStream
in interface DocumentPart
public java.util.List<Directive> getCustomDirectives()
DocumentPart
getCustomDirectives
in interface DocumentPart
public void addCustomDirective(java.lang.String key, java.lang.String value)
DocumentPart
addCustomDirective
in interface DocumentPart
key
- The custom directive namevalue
- The custom directive valuepublic java.lang.String getEncoding()
DocumentPart
getEncoding
in interface DocumentPart
public java.lang.String getFilename()
DocumentPart
getFilename
in interface DocumentPart
public java.lang.String getForcedMime()
DocumentPart
getForcedMime
in interface DocumentPart
public java.lang.String getMimeHint()
DocumentPart
getMimeHint
in interface DocumentPart
public java.lang.String getEncodingHint()
DocumentPart
getEncodingHint
in interface DocumentPart
public java.lang.String getName()
DocumentPart
getName
in interface DocumentPart
public void setContent(byte[] bytes)
DocumentPart
setContent
in interface DocumentPart
public void setContent(java.nio.ByteBuffer buffer)
DocumentPart
setContent
in interface DocumentPart
public long getContentLength()
DocumentPart
getContentLength
in interface DocumentPart
public void setContent(java.io.InputStream stream, long streamSize)
DocumentPart
setContent
in interface DocumentPart
public void setEncoding(java.lang.String encoding)
DocumentPart
setEncoding
in interface DocumentPart
encoding
- the encodingpublic void setFilename(java.lang.String filename)
setFilename
in interface DocumentPart
getFilename
public void setForcedMime(java.lang.String forcedMime)
DocumentPart
setForcedMime
in interface DocumentPart
forcedMime
- the forced MIME typepublic void setMimeHint(java.lang.String mimeHint)
DocumentPart
setMimeHint
in interface DocumentPart
mimeHint
- the MIME hintpublic void setEncodingHint(java.lang.String encodingHint)
DocumentPart
setEncodingHint
in interface DocumentPart
encodingHint
- the encoding hintpublic void setName(java.lang.String name)
setName
in interface DocumentPart
getName
Copyright © 2013 Dassault Systèmes, All Rights Reserved.