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 FileValuepublic String getMimeType()
getMimeType in interface FileValuepublic void setMimeType(String mimeType)
public void setValue(byte[] bytes)
public InputStream getValue()
TypedValuegetValue in interface FileValuegetValue in interface TypedValuepublic ValueType getType()
TypedValuegetType in interface TypedValuepublic void setEncoding(String encoding)
public void setEncoding(Charset encoding)
public Charset getEncodingAsCharset()
FileValueCharset.forName(String) lists.
If no encoding has been saved it will return null.
getEncodingAsCharset in interface FileValuepublic String getEncoding()
getEncoding in interface FileValuepublic byte[] getByteArray()
public boolean isTransient()
TypedValueisTransient in interface TypedValuepublic void setTransient(boolean isTransient)
Copyright © 2022. All rights reserved.