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:
  • Field Details

    • 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 Details

  • Method Details

    • getFilename

      public String getFilename()
      Specified by:
      getFilename in interface FileValue
    • getMimeType

      public String getMimeType()
      Specified by:
      getMimeType in interface FileValue
    • 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 interface FileValue
      Specified by:
      getValue in interface TypedValue
      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 interface TypedValue
      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 that Charset.forName(String) lists.

      If no encoding has been saved it will return null.

      Specified by:
      getEncodingAsCharset in interface FileValue
    • getEncoding

      public String getEncoding()
      Specified by:
      getEncoding in interface FileValue
      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 String toString()
      Overrides:
      toString in class Object
    • isTransient

      public boolean isTransient()
      Description copied from interface: TypedValue
      Indicator for transience of the value
      Specified by:
      isTransient in interface TypedValue
      Returns:
      isTransient
    • setTransient

      public void setTransient(boolean isTransient)