Package org.jbpm.document.service
Interface DocumentStorageService
-
- All Known Implementing Classes:
DocumentStorageServiceImpl
public interface DocumentStorageService
Simple storage service definition
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Document
buildDocument(String name, long size, Date lastModified, Map<String,String> params)
Generates a Document instance.boolean
deleteDocument(String id)
Deletes the File identified by the given idboolean
deleteDocument(Document document)
Deletes the File identified by the given idDocument
getDocument(String id)
Method to obtain a File for the given storage idList<Document>
listDocuments(Integer page, Integer pageSize)
Lists available document with paging support.byte[]
loadContent(String id)
Loads document contentDocument
saveDocument(Document document, byte[] content)
Method to store the uploaded file on the system
-
-
-
Method Detail
-
buildDocument
Document buildDocument(String name, long size, Date lastModified, Map<String,String> params)
Generates a Document instance.- Parameters:
name
- The document namesize
- The document sizelastModified
- The lastModified date of the documentparams
- A Mapcontaining the params to create the document. - Returns:
-
saveDocument
Document saveDocument(Document document, byte[] content)
Method to store the uploaded file on the system- Parameters:
document
- The document to store the contentcontent
- The document content- Returns:
- A Document
-
getDocument
Document getDocument(String id)
Method to obtain a File for the given storage id- Parameters:
id
- The Document id to obtain the Document- Returns:
- The java.io.File identified with the id
-
loadContent
byte[] loadContent(String id)
Loads document content- Parameters:
id
- unique id of the document- Returns:
- loaded document's content
-
deleteDocument
boolean deleteDocument(String id)
Deletes the File identified by the given id- Parameters:
id
- The Document id to delete- Returns:
- true if it was possible to remove, false if not
-
deleteDocument
boolean deleteDocument(Document document)
Deletes the File identified by the given id- Parameters:
document
- The Document to delete- Returns:
- true if it was possible to remove, false if not
-
-