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
-
Constructor Summary
-
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()
void
setAttribute
(String name, List<Object> values) Set a custom attribute value.void
setAttributes
(Map<String, List<Object>> attributes) void
setContent
(byte[] content) void
setContentType
(String contentType) void
boolean
validateMD5
(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
-