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 Stringencodingprotected Stringfilenameprotected booleanisTransientprotected StringmimeTypeprotected FileValueTypetypeprotected 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.StringgetEncoding()CharsetgetEncodingAsCharset()Convenience method to save the transformation.StringgetFilename()StringgetMimeType()ValueTypegetType()The type of the value.InputStreamgetValue()The actual value.booleanisTransient()Indicator for transience of the valuevoidsetEncoding(String encoding)voidsetEncoding(Charset encoding)voidsetMimeType(String mimeType)voidsetTransient(boolean isTransient)voidsetValue(byte[] bytes)StringtoString()
-
-
-
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:
getFilenamein interfaceFileValue
-
getMimeType
public String getMimeType()
- Specified by:
getMimeTypein interfaceFileValue
-
setMimeType
public void setMimeType(String mimeType)
-
setValue
public void setValue(byte[] bytes)
-
getValue
public InputStream getValue()
Description copied from interface:TypedValueThe actual value. May be null in case the value is null.- Specified by:
getValuein interfaceFileValue- Specified by:
getValuein interfaceTypedValue- Returns:
- the value
-
getType
public ValueType getType()
Description copied from interface:TypedValueThe type of the value. See ValueType for a list of built-in ValueTypes.- Specified by:
getTypein 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:FileValueConvenience 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:
getEncodingAsCharsetin interfaceFileValue
-
getEncoding
public String getEncoding()
- Specified by:
getEncodingin 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:TypedValueIndicator for transience of the value- Specified by:
isTransientin interfaceTypedValue- Returns:
- isTransient
-
setTransient
public void setTransient(boolean isTransient)
-
-