|
jBPM :: Document Service 6.2.0.Beta1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jbpm.document.service.impl.DocumentStorageServiceImpl
public class DocumentStorageServiceImpl
This a Sample Implementation of the DocumentStorageService saves the uploaded files on the File System on a folder (by default /docs) and return the complete path to the file that will be stored in the form field property. Check that the user that is running the app has write permissions on the storage folder.
Constructor Summary | |
---|---|
DocumentStorageServiceImpl()
|
Method Summary | |
---|---|
boolean |
deleteDocument(Document doc)
Deletes the File identified by the given id |
boolean |
deleteDocument(String id)
Deletes the File identified by the given id |
protected boolean |
deleteFile(File file)
|
protected String |
generateUniquePath(String fileName)
Generates a random path to store the file to avoid overwritting files with the same name |
Document |
getDocument(String id)
Method to obtain a File for the given storage id |
File |
getDocumentContent(Document doc)
|
Document |
saveDocument(Document document,
byte[] content)
Method to store the uploaded file on the system |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DocumentStorageServiceImpl()
Method Detail |
---|
public Document saveDocument(Document document, byte[] content)
DocumentStorageService
saveDocument
in interface DocumentStorageService
document
- The document to store the contentcontent
- The document content
public Document getDocument(String id)
DocumentStorageService
getDocument
in interface DocumentStorageService
id
- The Document id to obtain the Document
public boolean deleteDocument(String id)
DocumentStorageService
deleteDocument
in interface DocumentStorageService
id
- The Document id to delete
public boolean deleteDocument(Document doc)
DocumentStorageService
deleteDocument
in interface DocumentStorageService
doc
- The Document to delete
public File getDocumentContent(Document doc)
protected boolean deleteFile(File file)
protected String generateUniquePath(String fileName)
fileName
- The fileName that is going to be stored
|
jBPM :: Document Service 6.2.0.Beta1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |