Class WebDavDocumentService
- java.lang.Object
-
- org.silverpeas.core.contribution.attachment.webdav.impl.WebDavDocumentService
-
- All Implemented Interfaces:
WebdavService
@Service public class WebDavDocumentService extends Object implements WebdavService
-
-
Constructor Summary
Constructors Constructor Description WebDavDocumentService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getContentEditionLanguage(SimpleDocument document)
Gets the current content edition language of the specified attachment.long
getContentEditionSize(SimpleDocument document)
Gets the current content edition size of the specified attachment.Optional<WebdavContentDescriptor>
getDescriptor(SimpleDocument document)
Gets the current webdav descriptor of the specified attachment.void
loadContentInto(SimpleDocument document, OutputStream output)
Loads a document content from the WEBDAV repository and writes it into given output.void
updateContentFrom(SimpleDocument document, InputStream input)
Updates a document content into the WEBDAV repository.void
updateDocumentContent(SimpleDocument document)
Update the document content language with the data from the associated webdav node.
-
-
-
Method Detail
-
updateDocumentContent
public void updateDocumentContent(SimpleDocument document)
Description copied from interface:WebdavService
Update the document content language with the data from the associated webdav node.- Specified by:
updateDocumentContent
in interfaceWebdavService
- Parameters:
document
- the document for which the content language will be updated with data from webdav.
-
getContentEditionLanguage
public String getContentEditionLanguage(SimpleDocument document)
Description copied from interface:WebdavService
Gets the current content edition language of the specified attachment. If several webdav document exists (several content languages), then the one which has the highest modified date is taken into account.- Specified by:
getContentEditionLanguage
in interfaceWebdavService
- Parameters:
document
- the attachment.- Returns:
- the content edition language if the specified attachment exists in the webdav repository, null otherwise.
-
getContentEditionSize
public long getContentEditionSize(SimpleDocument document)
Description copied from interface:WebdavService
Gets the current content edition size of the specified attachment. If several webdav document exists (several content languages), then the one which has the highest modified date is taken into account.- Specified by:
getContentEditionSize
in interfaceWebdavService
- Parameters:
document
- the attachment.- Returns:
- the content edition size if the specified attachment exists in the webdav repository, -1 otherwise.
-
getDescriptor
public Optional<WebdavContentDescriptor> getDescriptor(SimpleDocument document)
Description copied from interface:WebdavService
Gets the current webdav descriptor of the specified attachment. If several webdav document exists (several content languages), then the one which has the highest modified date is taken into account.- Specified by:
getDescriptor
in interfaceWebdavService
- Parameters:
document
- the attachment.- Returns:
- the optional content edition webdav descriptor if the specified attachment exists in the webdav repository.
-
updateContentFrom
public void updateContentFrom(SimpleDocument document, InputStream input) throws IOException
Description copied from interface:WebdavService
Updates a document content into the WEBDAV repository.If several webdav document exists (several content languages), then the one which has the highest modified date is taken into account.
- Specified by:
updateContentFrom
in interfaceWebdavService
- Parameters:
document
- the aimed document.input
- the data to write.- Throws:
IOException
- when it is not possible to write physically the data.
-
loadContentInto
public void loadContentInto(SimpleDocument document, OutputStream output) throws IOException
Description copied from interface:WebdavService
Loads a document content from the WEBDAV repository and writes it into given output.If several webdav document exists (several content languages), then the one which has the highest modified date is taken into account.
- Specified by:
loadContentInto
in interfaceWebdavService
- Parameters:
document
- the aimed document.output
- the stream to write into.- Throws:
IOException
- when it is not possible to write physically the data.
-
-