Class FileData

java.lang.Object
org.imixs.workflow.FileData

public class FileData extends Object
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 Details

  • Constructor Details

  • Method Details

    • getName

      public String getName()
    • setName

      public void setName(String name)
    • getContent

      public byte[] getContent()
    • setContent

      public void setContent(byte[] content)
    • getContentType

      public String getContentType()
    • setContentType

      public void setContentType(String contentType)
    • getAttributes

      public Map<String,List<Object>> getAttributes()
    • setAttributes

      public void setAttributes(Map<String,List<Object>> attributes)
    • getAttribute

      public Object getAttribute(String name)
      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

      public void setAttribute(String name, List<Object> values)
      Set a custom attribute value.
      Parameters:
      name - a String specifying the name of the custom attribute
      values - an Object containing the value of the attribute
    • generateMD5

      public String generateMD5() throws NoSuchAlgorithmException
      Generates a MD5 from a current file content
      Returns:
      md5 string
      Throws:
      NoSuchAlgorithmException - - invalid algorithm
    • validateMD5

      public boolean validateMD5(String checksum) throws NoSuchAlgorithmException
      Validates a given MD5 checksum
      Parameters:
      checksum - - checksum to validate
      Returns:
      true if equal
      Throws:
      NoSuchAlgorithmException - - invalid algorithm