Class FileResource
java.lang.Object
org.exoplatform.services.jcr.webdav.resource.GenericResource
org.exoplatform.services.jcr.webdav.resource.FileResource
- All Implemented Interfaces:
Resource,PropertyConstants
- Direct Known Subclasses:
VersionedFileResource
Created by The eXo Platform SARL .
Resource containing JCR's nt:file/jcr:content underneath. Identified by nt:file's URI jcr:content's jcr:data property contains file's payload
Resource containing JCR's nt:file/jcr:content underneath. Identified by nt:file's URI jcr:content's jcr:data property contains file's payload
- Version:
- $Id$
- Author:
- Gennady Azarenkov
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe list of properties which are skipped for jcr:content.The list of properties which are skipped for nt:file.protected final javax.jcr.NodeNode.Fields inherited from class org.exoplatform.services.jcr.webdav.resource.GenericResource
identifier, namespaceContext, PRESET_PROP, typeFields 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, WRITEFields inherited from interface org.exoplatform.services.jcr.webdav.resource.Resource
COLLECTION, FILE, NULL, VERSION, VERSION_HISTORY, VERSIONED_COLLECTION, VERSIONED_FILE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFileResource(int type, URI identifier, javax.jcr.Node node, WebDavNamespaceContext namespaceContext) FileResource(URI identifier, javax.jcr.Node node, WebDavNamespaceContext namespaceContext) -
Method Summary
Modifier and TypeMethodDescriptionprotected javax.jcr.NodeReturns the content node.protected javax.jcr.PropertyReturns the data property.Returns the content of node as stream.Returns the content of node as text.Set<org.exoplatform.common.util.HierarchicalProperty>getProperties(boolean namesOnly) org.exoplatform.common.util.HierarchicalPropertygetProperty(QName name) booleanbooleanif the content of node is text.Methods inherited from class org.exoplatform.services.jcr.webdav.resource.GenericResource
decodeValue, getIdentifier, getNamespaceContext, getType, lockDiscovery, supportedLock, supportedMethodSet
-
Field Details
-
FILE_SKIP
The list of properties which are skipped for nt:file. -
CONTENT_SKIP
The list of properties which are skipped for jcr:content. -
node
protected final javax.jcr.Node nodeNode.
-
-
Constructor Details
-
FileResource
public FileResource(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
-
FileResource
protected FileResource(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:
IllegalResourceTypeExceptionjavax.jcr.RepositoryException
-
-
Method Details
-
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
-
getContentAsText
Returns the content of node as text.- Returns:
- content as text
- Throws:
javax.jcr.RepositoryException-RepositoryException
-
getContentAsStream
Returns the content of node as stream.- Returns:
- content as stream
- Throws:
javax.jcr.RepositoryException-RepositoryException
-
isTextContent
public boolean isTextContent()if the content of node is text.- Returns:
- true if the content of node is text false if not
-
contentNode
protected javax.jcr.Node contentNode() throws javax.jcr.RepositoryExceptionReturns the content node.- Returns:
- Node, the content node
- Throws:
javax.jcr.RepositoryException-RepositoryException
-
dataProperty
protected javax.jcr.Property dataProperty() throws javax.jcr.RepositoryExceptionReturns the data property.- Returns:
- Property, the content data property
- Throws:
javax.jcr.RepositoryException-RepositoryException
-