Class FileValueImpl

    • Field Detail

      • mimeType

        protected java.lang.String mimeType
      • filename

        protected java.lang.String filename
      • value

        protected byte[] value
      • 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 interface FileValue
      • getMimeType

        public java.lang.String getMimeType()
        Specified by:
        getMimeType in interface FileValue
      • setMimeType

        public void setMimeType​(java.lang.String mimeType)
      • setValue

        public void setValue​(byte[] bytes)
      • getValue

        public 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
        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
        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 that Charset.forName(String) lists.

        If no encoding has been saved it will return null.

        Specified by:
        getEncodingAsCharset in interface FileValue
      • getEncoding

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

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

        public void setTransient​(boolean isTransient)