public class FileValueImpl extends Object implements FileValue
Modifier and Type | Field and Description |
---|---|
protected String |
encoding |
protected String |
filename |
protected boolean |
isTransient |
protected String |
mimeType |
protected FileValueType |
type |
protected byte[] |
value |
Constructor and Description |
---|
FileValueImpl(byte[] value,
FileValueType type,
String filename,
String mimeType,
String encoding) |
FileValueImpl(FileValueType type,
String filename) |
Modifier and Type | Method and 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 value
|
void |
setEncoding(Charset encoding) |
void |
setEncoding(String encoding) |
void |
setMimeType(String mimeType) |
void |
setTransient(boolean isTransient) |
void |
setValue(byte[] bytes) |
String |
toString() |
protected String mimeType
protected String filename
protected byte[] value
protected FileValueType type
protected String encoding
protected boolean isTransient
public FileValueImpl(byte[] value, FileValueType type, String filename, String mimeType, String encoding)
public FileValueImpl(FileValueType type, String filename)
public String getFilename()
getFilename
in interface FileValue
public String getMimeType()
getMimeType
in interface FileValue
public void setMimeType(String mimeType)
public void setValue(byte[] bytes)
public InputStream getValue()
TypedValue
getValue
in interface FileValue
getValue
in interface TypedValue
public ValueType getType()
TypedValue
getType
in interface TypedValue
public void setEncoding(String encoding)
public void setEncoding(Charset encoding)
public Charset getEncodingAsCharset()
FileValue
Charset.forName(String)
lists.
If no encoding has been saved it will return null.
getEncodingAsCharset
in interface FileValue
public String getEncoding()
getEncoding
in interface FileValue
public byte[] getByteArray()
public boolean isTransient()
TypedValue
isTransient
in interface TypedValue
public void setTransient(boolean isTransient)
Copyright © 2019. All rights reserved.