public class Part
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected ContentStream |
contentStream
Part content.
|
protected KeyValuesContainer<java.lang.String,java.lang.String> |
directives
Part directives.
|
static java.lang.String |
MASTER_PART_NAME
Default name of the master part.
|
protected java.lang.String |
name
Part name.
|
Constructor and Description |
---|
Part(byte[] bytes)
Constructor specifying the content as an array of bytes.
|
Part(ContentStream data)
Constructor specifying a content stream.
|
Part(java.lang.String name,
byte[] bytes)
Constructor specifying a part name and an array of bytes.
|
Part(java.lang.String name,
ContentStream data)
Constructor specifying a part name and a content stream.
|
Modifier and Type | Method and Description |
---|---|
void |
addCustomDirective(java.lang.String key,
java.lang.String value)
Adds a new custom directive.
|
void |
addCustomDirectives(java.lang.String key,
java.util.List<java.lang.String> values)
Adds a new multi valued custom directive.
|
java.lang.String |
getCertifiedMime()
Gets the value of the mime directive.
|
java.lang.String |
getCertifiedMine()
Deprecated.
|
ContentStream |
getContentStream()
Deprecated.
|
ContentStreamSafe |
getContentStreamSafe()
Get the part content stream.
|
KeyValuesContainer<java.lang.String,java.lang.String> |
getDirectiveContainer()
Gets the directives container associated with this part.
|
java.lang.String |
getEncoding()
Gets the value of the encoding directive.
|
java.lang.String |
getEncodingHint()
Gets the value of the encodingHint directive.
|
java.lang.String |
getFileName()
Gets the value of the filename directive.
|
long |
getLength()
Get the size of the part content.
|
java.lang.String |
getMimeHint()
Gets the value of the mimeHint directive.
|
java.lang.String |
getName()
Get the part name.
|
java.io.InputStream |
getStream()
Get the underlying content input stream.
|
boolean |
isMaster()
Helper function which checks whether this part is the master
part.
|
void |
setAsMaster()
Helper function which sets this part as the master part.
|
void |
setCertifiedMime(java.lang.String value)
Sets the mime directive.
|
void |
setEncoding(java.lang.String value)
Sets the encoding directive.
|
void |
setEncodingHint(java.lang.String value)
Sets the encodingHint directive.
|
void |
setFileName(java.lang.String value)
Sets the filename directive.
|
void |
setMimeHint(java.lang.String value)
Sets the mimeHint directive.
|
void |
setName(java.lang.String name)
Set the part name.
|
public static final java.lang.String MASTER_PART_NAME
protected KeyValuesContainer<java.lang.String,java.lang.String> directives
protected java.lang.String name
protected ContentStream contentStream
public Part(byte[] bytes)
bytes
- A part of document content.public Part(java.lang.String name, byte[] bytes)
name
- Part name.bytes
- A part of document content.public Part(ContentStream data)
data
- the content streampublic Part(java.lang.String name, ContentStream data)
name
- the name of the part.data
- the content stream.public long getLength()
public boolean isMaster()
true
if this part is the master part,
false
otherwise.public void setAsMaster()
public java.lang.String getName()
public void setName(java.lang.String name)
public java.io.InputStream getStream()
@Deprecated public ContentStream getContentStream()
public ContentStreamSafe getContentStreamSafe()
public java.lang.String getMimeHint()
public void setMimeHint(java.lang.String value)
value
- the value of the mimeHint directive.public java.lang.String getCertifiedMime()
@Deprecated public java.lang.String getCertifiedMine()
public void setCertifiedMime(java.lang.String value)
value
- the value of the mime directive.public java.lang.String getEncoding()
public void setEncoding(java.lang.String value)
value
- the value of the encoding directive.public java.lang.String getEncodingHint()
public void setEncodingHint(java.lang.String value)
value
- the value of the encoding directive.public java.lang.String getFileName()
public void setFileName(java.lang.String value)
value
- the value of the filename directive.public void addCustomDirective(java.lang.String key, java.lang.String value)
key
- the directive namevalue
- the directive valuepublic void addCustomDirectives(java.lang.String key, java.util.List<java.lang.String> values)
key
- the directive name.value
- the directive value.public KeyValuesContainer<java.lang.String,java.lang.String> getDirectiveContainer()
Copyright © 2021 Dassault Systèmes, All Rights Reserved.