Class FileValueImpl
- java.lang.Object
-
- org.camunda.bpm.engine.variable.impl.value.FileValueImpl
-
- All Implemented Interfaces:
Serializable
,FileValue
,TypedValue
- Direct Known Subclasses:
DeferredFileValueImpl
public class FileValueImpl extends Object implements FileValue
- Since:
- 7.4
- Author:
- Ronny Bräunlich
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
encoding
protected String
filename
protected boolean
isTransient
protected String
mimeType
protected FileValueType
type
protected byte[]
value
-
Constructor Summary
Constructors Constructor Description FileValueImpl(byte[] value, FileValueType type, String filename, String mimeType, String encoding)
FileValueImpl(FileValueType type, String filename)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getByteArray()
Get the byte array directly without wrapping it inside a stream to evade not needed wrapping.String
getEncoding()
Charset
getEncodingAsCharset()
Convenience method to save the transformation.String
getFilename()
String
getMimeType()
ValueType
getType()
The type of the value.InputStream
getValue()
The actual value.boolean
isTransient()
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)
String
toString()
-
-
-
Field Detail
-
mimeType
protected String mimeType
-
filename
protected String filename
-
value
protected byte[] value
-
type
protected FileValueType type
-
encoding
protected String encoding
-
isTransient
protected boolean isTransient
-
-
Constructor Detail
-
FileValueImpl
public FileValueImpl(byte[] value, FileValueType type, String filename, String mimeType, String encoding)
-
FileValueImpl
public FileValueImpl(FileValueType type, String filename)
-
-
Method Detail
-
getFilename
public String getFilename()
- Specified by:
getFilename
in interfaceFileValue
-
getMimeType
public String getMimeType()
- Specified by:
getMimeType
in interfaceFileValue
-
setMimeType
public void setMimeType(String mimeType)
-
setValue
public void setValue(byte[] bytes)
-
getValue
public InputStream 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
public ValueType 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
public void setEncoding(String encoding)
-
setEncoding
public void setEncoding(Charset encoding)
-
getEncodingAsCharset
public Charset 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
public String 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.
-
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)
-
-