Class FileValueImpl
java.lang.Object
org.camunda.bpm.engine.variable.impl.value.FileValueImpl
- All Implemented Interfaces:
Serializable
,FileValue
,TypedValue
- Direct Known Subclasses:
DeferredFileValueImpl
- Since:
- 7.4
- Author:
- Ronny Bräunlich
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
protected String
protected boolean
protected String
protected FileValueType
protected byte[]
-
Constructor Summary
ConstructorDescriptionFileValueImpl
(byte[] value, FileValueType type, String filename, String mimeType, String encoding) FileValueImpl
(FileValueType type, String filename) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Get the byte array directly without wrapping it inside a stream to evade not needed wrapping.Convenience method to save the transformation.getType()
The type of the value.getValue()
The actual value.boolean
Indicator for transience of the valuevoid
setEncoding
(String encoding) void
setEncoding
(Charset encoding) void
setMimeType
(String mimeType) void
setTransient
(boolean isTransient) void
setValue
(byte[] bytes) toString()
-
Field Details
-
mimeType
-
filename
-
value
protected byte[] value -
type
-
encoding
-
isTransient
protected boolean isTransient
-
-
Constructor Details
-
FileValueImpl
public FileValueImpl(byte[] value, FileValueType type, String filename, String mimeType, String encoding) -
FileValueImpl
-
-
Method Details
-
getFilename
- Specified by:
getFilename
in interfaceFileValue
-
getMimeType
- Specified by:
getMimeType
in interfaceFileValue
-
setMimeType
-
setValue
public void setValue(byte[] bytes) -
getValue
Description copied from interface:TypedValue
The actual value. May be null in case the value is null.- Specified by:
getValue
in interfaceFileValue
- Specified by:
getValue
in interfaceTypedValue
- Returns:
- the value
-
getType
Description copied from interface:TypedValue
The type of the value. See ValueType for a list of built-in ValueTypes.- Specified by:
getType
in interfaceTypedValue
- Returns:
- the type of the value.
-
setEncoding
-
setEncoding
-
getEncodingAsCharset
Description copied from interface:FileValue
Convenience method to save the transformation. This method will perform no check if the saved encoding is known to the JVM and therefore could throw every exception thatCharset.forName(String)
lists.If no encoding has been saved it will return null.
- Specified by:
getEncodingAsCharset
in interfaceFileValue
-
getEncoding
- Specified by:
getEncoding
in interfaceFileValue
- Returns:
- the saved encoding or null if none has been saved
-
getByteArray
public byte[] getByteArray()Get the byte array directly without wrapping it inside a stream to evade not needed wrapping. This method is intended for the internal API, which needs the byte array anyways. -
toString
-
isTransient
public boolean isTransient()Description copied from interface:TypedValue
Indicator for transience of the value- Specified by:
isTransient
in interfaceTypedValue
- Returns:
- isTransient
-
setTransient
public void setTransient(boolean isTransient)
-