Class FileValueImpl
- java.lang.Object
-
- org.camunda.bpm.engine.variable.impl.value.FileValueImpl
-
- All Implemented Interfaces:
java.io.Serializable
,FileValue
,TypedValue
- Direct Known Subclasses:
DeferredFileValueImpl
public class FileValueImpl extends java.lang.Object implements FileValue
- Since:
- 7.4
- Author:
- Ronny Bräunlich
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
encoding
protected java.lang.String
filename
protected boolean
isTransient
protected java.lang.String
mimeType
protected FileValueType
type
protected byte[]
value
-
Constructor Summary
Constructors Constructor Description FileValueImpl(byte[] value, FileValueType type, java.lang.String filename, java.lang.String mimeType, java.lang.String encoding)
FileValueImpl(FileValueType type, java.lang.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.java.lang.String
getEncoding()
java.nio.charset.Charset
getEncodingAsCharset()
Convenience method to save the transformation.java.lang.String
getFilename()
java.lang.String
getMimeType()
ValueType
getType()
The type of the value.java.io.InputStream
getValue()
The actual value.boolean
isTransient()
Indicator for transience of the valuevoid
setEncoding(java.lang.String encoding)
void
setEncoding(java.nio.charset.Charset encoding)
void
setMimeType(java.lang.String mimeType)
void
setTransient(boolean isTransient)
void
setValue(byte[] bytes)
java.lang.String
toString()
-
-
-
Field Detail
-
mimeType
protected java.lang.String mimeType
-
filename
protected java.lang.String filename
-
value
protected byte[] value
-
type
protected FileValueType type
-
encoding
protected java.lang.String encoding
-
isTransient
protected boolean isTransient
-
-
Constructor Detail
-
FileValueImpl
public FileValueImpl(byte[] value, FileValueType type, java.lang.String filename, java.lang.String mimeType, java.lang.String encoding)
-
FileValueImpl
public FileValueImpl(FileValueType type, java.lang.String filename)
-
-
Method Detail
-
getFilename
public java.lang.String getFilename()
- Specified by:
getFilename
in interfaceFileValue
-
getMimeType
public java.lang.String getMimeType()
- Specified by:
getMimeType
in interfaceFileValue
-
setMimeType
public void setMimeType(java.lang.String mimeType)
-
setValue
public void setValue(byte[] bytes)
-
getValue
public java.io.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(java.lang.String encoding)
-
setEncoding
public void setEncoding(java.nio.charset.Charset encoding)
-
getEncodingAsCharset
public java.nio.charset.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 java.lang.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.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
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)
-
-