Package org.imixs.workflow
Class FileData
java.lang.Object
org.imixs.workflow.FileData
Helper class to abstract the file content stored in a ItemCollection.
A FileData object contains at least the attributes 'name', 'content' and
'contentType'. The optional object custom attributes can be added. It
represents a Map<String, List<Object>>
- Version:
- 2.0
- Author:
- rsoika
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGenerates a MD5 from a current file contentgetAttribute(String name) Returns the value of the named custom attribute as an Object, or null if no attribute of the given name exists.byte[]getName()voidsetAttribute(String name, List<Object> values) Set a custom attribute value.voidsetAttributes(Map<String, List<Object>> attributes) voidsetContent(byte[] content) voidsetContentType(String contentType) voidbooleanvalidateMD5(String checksum) Validates a given MD5 checksum
-
Field Details
-
DEFAULT_CONTENT_TYPE
- See Also:
-
-
Constructor Details
-
FileData
-
-
Method Details
-
getName
-
setName
-
getContent
public byte[] getContent() -
setContent
public void setContent(byte[] content) -
getContentType
-
setContentType
-
getAttributes
-
setAttributes
-
getAttribute
Returns the value of the named custom attribute as an Object, or null if no attribute of the given name exists. A custom attribute can be set by the method setAttribute().- Parameters:
name- a String specifying the name of the custom attribute
-
setAttribute
Set a custom attribute value.- Parameters:
name- a String specifying the name of the custom attributevalues- an Object containing the value of the attribute
-
generateMD5
Generates a MD5 from a current file content- Returns:
- md5 string
- Throws:
NoSuchAlgorithmException- - invalid algorithm
-
validateMD5
Validates a given MD5 checksum- Parameters:
checksum- - checksum to validate- Returns:
- true if equal
- Throws:
NoSuchAlgorithmException- - invalid algorithm
-