Class CollectionResource
- java.lang.Object
-
- org.exoplatform.services.jcr.webdav.resource.GenericResource
-
- org.exoplatform.services.jcr.webdav.resource.CollectionResource
-
- All Implemented Interfaces:
Resource,PropertyConstants
- Direct Known Subclasses:
VersionedCollectionResource
public class CollectionResource extends GenericResource
Created by The eXo Platform SARL .
Other than nt:file/jcr:content(nt:resource)- Version:
- $Id: $
- Author:
- Gennady Azarenkov
-
-
Field Summary
Fields Modifier and Type Field Description protected static Set<String>COLLECTION_SKIPProperties skipped for collections.protected javax.jcr.Nodenodenode.-
Fields inherited from class org.exoplatform.services.jcr.webdav.resource.GenericResource
identifier, namespaceContext, PRESET_PROP, type
-
Fields inherited from interface org.exoplatform.services.jcr.webdav.util.PropertyConstants
CHILDCOUNT, CREATION_PATTERN, CREATIONDATE, DAV_ALLPROP, DAV_ALLPROP_INCLUDE, DISPLAYNAME, EXCLUSIVE, GETCONTENTLANGUAGE, GETCONTENTLENGTH, GETCONTENTTYPE, GETLASTMODIFIED, HASCHILDREN, IS_READ_ONLY, ISCOLLECTION, ISFOLDER, ISROOT, ISVERSIONED, JCR_CONTENT, JCR_DATA, LOCKDISCOVERY, LOCKSCOPE, LOCKTYPE, MODIFICATION_PATTERN, ORDERING_TYPE, OWNER, PARENTNAME, RESOURCETYPE, SUPPORTEDLOCK, SUPPORTEDMETHODSET, WRITE
-
Fields inherited from interface org.exoplatform.services.jcr.webdav.resource.Resource
COLLECTION, FILE, NULL, VERSION, VERSION_HISTORY, VERSIONED_COLLECTION, VERSIONED_FILE
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCollectionResource(int type, URI identifier, javax.jcr.Node node, WebDavNamespaceContext namespaceContext)CollectionResource(URI identifier, javax.jcr.Node node, WebDavNamespaceContext namespaceContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected URIchildURI(String childName)InputStreamgetContentAsStream(String rootHref)make a xml representation of the collection and serialize it to stream.Set<org.exoplatform.common.util.HierarchicalProperty>getProperties(boolean namesOnly)org.exoplatform.common.util.HierarchicalPropertygetProperty(QName name)List<Resource>getResources()booleanisCollection()-
Methods inherited from class org.exoplatform.services.jcr.webdav.resource.GenericResource
decodeValue, getIdentifier, getNamespaceContext, getType, lockDiscovery, supportedLock, supportedMethodSet
-
-
-
-
Constructor Detail
-
CollectionResource
public CollectionResource(URI identifier, javax.jcr.Node node, WebDavNamespaceContext namespaceContext) throws IllegalResourceTypeException, javax.jcr.RepositoryException
- Parameters:
identifier- resource identifiernode- nodenamespaceContext- namespace context- Throws:
IllegalResourceTypeException-IllegalResourceTypeExceptionjavax.jcr.RepositoryException-RepositoryException
-
CollectionResource
protected CollectionResource(int type, URI identifier, javax.jcr.Node node, WebDavNamespaceContext namespaceContext) throws IllegalResourceTypeException, javax.jcr.RepositoryException- Parameters:
type- resource typeidentifier- resource identifiernode- nodenamespaceContext- namespace context- Throws:
IllegalResourceTypeException-IllegalResourceTypeExceptionjavax.jcr.RepositoryException-RepositoryException
-
-
Method Detail
-
getProperties
public Set<org.exoplatform.common.util.HierarchicalProperty> getProperties(boolean namesOnly) throws javax.jcr.PathNotFoundException, javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
- Specified by:
getPropertiesin interfaceResource- Overrides:
getPropertiesin classGenericResource- Parameters:
namesOnly- - if true "empty" properties will be returned (w/o values inside)- Returns:
- all properties belonging to this resource
- Throws:
javax.jcr.RepositoryException-RepositoryExceptionjavax.jcr.PathNotFoundExceptionjavax.jcr.AccessDeniedException
-
getProperty
public org.exoplatform.common.util.HierarchicalProperty getProperty(QName name) throws javax.jcr.PathNotFoundException, javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
- Parameters:
name- property name- Returns:
- property by its name
- Throws:
javax.jcr.PathNotFoundException-PathNotFoundExceptionjavax.jcr.AccessDeniedException-AccessDeniedExceptionjavax.jcr.RepositoryException-RepositoryException
-
isCollection
public boolean isCollection()
- Returns:
- true if this is collection-able resource - i.e. this resource may contain other resources
-
getResources
public List<Resource> getResources() throws javax.jcr.RepositoryException, IllegalResourceTypeException
- Returns:
- the list of all child resources
- Throws:
javax.jcr.RepositoryException-RepositoryExceptionIllegalResourceTypeException-IllegalResourceTypeException
-
childURI
protected final URI childURI(String childName)
- Parameters:
childName- child name- Returns:
- child URI
-
getContentAsStream
public InputStream getContentAsStream(String rootHref) throws IOException
make a xml representation of the collection and serialize it to stream.- Parameters:
rootHref- root HRef- Returns:
- content wrapped into stream
- Throws:
IOException-IOException
-
-