Class ResourceServiceImpl
java.lang.Object
com.logicaldoc.webdav.resource.service.ResourceServiceImpl
- All Implemented Interfaces:
- ResourceService,- Serializable
@Component("resourceService")
public class ResourceServiceImpl
extends Object
implements ResourceService
Base implementation of a 
ResourceService- Author:
- Sebastian Wenzky
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddBookmark(Resource resource, WebdavSession session) voidcheckout(Resource resource, WebdavSession session) Versioning-part.voidcopy(Resource source, Resource destination, String newName, WebdavSession session) Copying of a resource within logicalDOC.createResource(Resource parentResource, String name, boolean isCollection, ImportContext context, WebdavSession session) Handle of resource creation by passed parent resource as well as the most import parameters needed for a resource creation.voiddeleteBookmark(Resource resource, WebdavSession session) voiddeleteResource(Resource resource, WebdavSession session) Deletion of a resource within logicalDOC.getChildByName(Resource parentResource, String name) Based on the parent resource it will be tried to get a child by a specific namegetChildResources(Resource parentResource) On passing a validgetHistory(Resource resource) Versioning-part.getParentResource(Resource resource) Based on the current resource location it will be turned back the upper resourcegetParentResource(String resourcePath, long userId, WebdavSession session) Based on a location pathgetResource(String requestPath, WebdavSession session) On passing a location as well as the current session you gettin back the appropriated resource.move(Resource source, Resource destination, String newName, WebdavSession session) Moves a resource named target to the folder dictionary destinationvoidsetDocumentDAO(DocumentDAO documentDAO) voidsetDocumentManager(DocumentManager documentManager) voidsetFolderDAO(FolderDAO folderDAO) voidvoidsetUserDAO(UserDAO userDAO) voidsetVersionDAO(VersionDAO versionDAO) Gets the stream for a resourcevoiduncheckout(Resource resource, WebdavSession session) Cancels a checkoutvoidupdateResource(Resource resource, ImportContext context, WebdavSession session) Updating a resource on passing all new properties though a valid resource object.
- 
Constructor Details- 
ResourceServiceImplpublic ResourceServiceImpl()
 
- 
- 
Method Details- 
setUserDAO
- 
setDocumentDAO
- 
setDocumentManager
- 
setVersionDAO
- 
setFolderDAO
- 
setStore
- 
getChildResourcespublic List<Resource> getChildResources(Resource parentResource) throws org.apache.jackrabbit.webdav.DavException Description copied from interface:ResourceServiceOn passing a valid- Specified by:
- getChildResourcesin interface- ResourceService
- Parameters:
- parentResource- The resource(mostly a folder) from which are all direct childs has to be fetched and turned back s
- Returns:
- direct childs of the parent resource
- Throws:
- org.apache.jackrabbit.webdav.DavException- error in the DAV communication
- See Also:
 
- 
getResourcepublic Resource getResource(String requestPath, WebdavSession session) throws org.apache.jackrabbit.webdav.DavException Description copied from interface:ResourceServiceOn passing a location as well as the current session you gettin back the appropriated resource.- Specified by:
- getResourcein interface- ResourceService
- Parameters:
- requestPath- The location retrieved through (@see DavResourceLocator#getResourcePath())
- session- The current session
- Returns:
- the DAV resource
- Throws:
- org.apache.jackrabbit.webdav.DavException- error in the DAV communication
 
- 
getParentResourcepublic Resource getParentResource(String resourcePath, long userId, WebdavSession session) throws org.apache.jackrabbit.webdav.DavException Description copied from interface:ResourceServiceBased on a location path- Specified by:
- getParentResourcein interface- ResourceService
- Parameters:
- resourcePath- the resource path
- userId- the user id
- session- the current session
- Returns:
- the parent resource
- Throws:
- org.apache.jackrabbit.webdav.DavException- error in the DAV communication
- See Also:
 
- 
createResourcepublic Resource createResource(Resource parentResource, String name, boolean isCollection, ImportContext context, WebdavSession session) throws org.apache.jackrabbit.webdav.DavException Description copied from interface:ResourceServiceHandle of resource creation by passed parent resource as well as the most import parameters needed for a resource creation.- Specified by:
- createResourcein interface- ResourceService
- Parameters:
- parentResource- The parent resource(mostly a folder)
- name- the filename and titlename of the child
- isCollection- is the resource folder?
- context- for inputstream
- session- the current session
- Returns:
- the newly created Resource
- Throws:
- org.apache.jackrabbit.webdav.DavException- error in the DAV communication
 
- 
updateResourcepublic void updateResource(Resource resource, ImportContext context, WebdavSession session) throws org.apache.jackrabbit.webdav.DavException Description copied from interface:ResourceServiceUpdating a resource on passing all new properties though a valid resource object. This resource object must correspond on the ID attribute with a valid resource in logicalDOC.- Specified by:
- updateResourcein interface- ResourceService
- Parameters:
- resource- The updateable resource
- context- the ImportContext
- session- the current session
- Throws:
- org.apache.jackrabbit.webdav.DavException- error in the DAV communication
 
- 
getChildByNamepublic Resource getChildByName(Resource parentResource, String name) throws org.apache.jackrabbit.webdav.DavException Description copied from interface:ResourceServiceBased on the parent resource it will be tried to get a child by a specific name- Specified by:
- getChildByNamein interface- ResourceService
- Parameters:
- parentResource- The parent resource
- name- name of the child must be
- Returns:
- The resource that matches, else it will be returned null
- Throws:
- org.apache.jackrabbit.webdav.DavException- error in the DAV communication
 
- 
movepublic Resource move(Resource source, Resource destination, String newName, WebdavSession session) throws org.apache.jackrabbit.webdav.DavException Description copied from interface:ResourceServiceMoves a resource named target to the folder dictionary destination- Specified by:
- movein interface- ResourceService
- Parameters:
- source- the resource that is involved
- destination- the destination folder of the move operation
- newName- optional different name to give to the moved item
- session- the current session
- Returns:
- the moved resource
- Throws:
- org.apache.jackrabbit.webdav.DavException- error in the DAV communication
 
- 
deleteResourcepublic void deleteResource(Resource resource, WebdavSession session) throws org.apache.jackrabbit.webdav.DavException Description copied from interface:ResourceServiceDeletion of a resource within logicalDOC.- Specified by:
- deleteResourcein interface- ResourceService
- Parameters:
- resource- a valid resource
- session- the current session
- Throws:
- org.apache.jackrabbit.webdav.DavException- error in the DAV communication
 
- 
copypublic void copy(Resource source, Resource destination, String newName, WebdavSession session) throws org.apache.jackrabbit.webdav.DavException Description copied from interface:ResourceServiceCopying of a resource within logicalDOC.- Specified by:
- copyin interface- ResourceService
- Parameters:
- source- the DAV resource
- destination- target resource (must be a folder)
- newName- optional new name for the copied resource
- session- the current session
- Throws:
- org.apache.jackrabbit.webdav.DavException- error in the DAV communication
 
- 
getParentResourcepublic Resource getParentResource(Resource resource) throws org.apache.jackrabbit.webdav.DavException Description copied from interface:ResourceServiceBased on the current resource location it will be turned back the upper resource- Specified by:
- getParentResourcein interface- ResourceService
- Parameters:
- resource- the current resource
- Returns:
- the parent resource
- Throws:
- org.apache.jackrabbit.webdav.DavException- error in the DAV communication
 
- 
streamOutDescription copied from interface:ResourceServiceGets the stream for a resource- Specified by:
- streamOutin interface- ResourceService
- Parameters:
- resource- the DAV resource
- Returns:
- the stream of the resource
- Throws:
- org.apache.jackrabbit.webdav.DavException- error in the DAV communicationn
 
- 
checkoutpublic void checkout(Resource resource, WebdavSession session) throws org.apache.jackrabbit.webdav.DavException Description copied from interface:ResourceServiceVersioning-part. Checkout causes the system to make a version "overwriteable" to put a new version on it.- Specified by:
- checkoutin interface- ResourceService
- Parameters:
- resource- The appropriated resource that has to be checked out
- session- the current session
- Throws:
- org.apache.jackrabbit.webdav.DavException- error in the DAV communication
 
- 
getHistoryDescription copied from interface:ResourceServiceVersioning-part. Based upon the current resource, the versionhistory is returned matches to this resource.- Specified by:
- getHistoryin interface- ResourceService
- Parameters:
- resource- The appropriated resource
- Returns:
- All Versions
 
- 
uncheckoutpublic void uncheckout(Resource resource, WebdavSession session) throws org.apache.jackrabbit.webdav.DavException Description copied from interface:ResourceServiceCancels a checkout- Specified by:
- uncheckoutin interface- ResourceService
- Parameters:
- resource- the DAV resource
- session- the current session
- Throws:
- org.apache.jackrabbit.webdav.DavException- error in the DAV communication
 
- 
addBookmarkpublic void addBookmark(Resource resource, WebdavSession session) throws org.apache.jackrabbit.webdav.DavException - Specified by:
- addBookmarkin interface- ResourceService
- Throws:
- org.apache.jackrabbit.webdav.DavException
 
- 
deleteBookmarkpublic void deleteBookmark(Resource resource, WebdavSession session) throws org.apache.jackrabbit.webdav.DavException - Specified by:
- deleteBookmarkin interface- ResourceService
- Throws:
- org.apache.jackrabbit.webdav.DavException
 
 
-