org.apache.jackrabbit.webdav.simple
Class DavResourceImpl

java.lang.Object
  extended by org.apache.jackrabbit.webdav.simple.DavResourceImpl
All Implemented Interfaces:
JcrConstants, BindableResource, DavResource
Direct Known Subclasses:
DeltaVResourceImpl

public class DavResourceImpl
extends Object
implements DavResource, BindableResource, JcrConstants

DavResourceImpl implements a DavResource.


Field Summary
static String COMPLIANCE_CLASSES
           
static String METHODS
           
protected  DavPropertySet properties
           
protected  boolean propsInitialized
           
 
Fields inherited from interface org.apache.jackrabbit.JcrConstants
JCR_AUTOCREATED, JCR_BASEVERSION, JCR_CONTENT, JCR_CREATED, JCR_DATA, JCR_DEFAULTPRIMARYTYPE, JCR_DEFAULTVALUES, JCR_ENCODING, JCR_FROZENMIXINTYPES, JCR_FROZENNODE, JCR_FROZENPRIMARYTYPE, JCR_FROZENUUID, JCR_HASORDERABLECHILDNODES, JCR_CHILD, JCR_CHILDNODEDEFINITION, JCR_ISCHECKEDOUT, JCR_ISMIXIN, JCR_LANGUAGE, JCR_LASTMODIFIED, JCR_LOCKISDEEP, JCR_LOCKOWNER, JCR_MANDATORY, JCR_MERGEFAILED, JCR_MIMETYPE, JCR_MIXINTYPES, JCR_MULTIPLE, JCR_NAME, JCR_NODETYPENAME, JCR_ONPARENTVERSION, JCR_PATH, JCR_PREDECESSORS, JCR_PRIMARYITEMNAME, JCR_PRIMARYTYPE, JCR_PROPERTYDEFINITION, JCR_PROTECTED, JCR_REQUIREDPRIMARYTYPES, JCR_REQUIREDTYPE, JCR_ROOTVERSION, JCR_SAMENAMESIBLINGS, JCR_SCORE, JCR_STATEMENT, JCR_SUCCESSORS, JCR_SUPERTYPES, JCR_SYSTEM, JCR_UUID, JCR_VALUECONSTRAINTS, JCR_VERSIONABLEUUID, JCR_VERSIONHISTORY, JCR_VERSIONLABELS, JCR_VERSIONSTORAGE, MIX_LOCKABLE, MIX_REFERENCEABLE, MIX_SHAREABLE, MIX_VERSIONABLE, NT_BASE, NT_FILE, NT_FOLDER, NT_FROZENNODE, NT_HIERARCHYNODE, NT_CHILDNODEDEFINITION, NT_LINKEDFILE, NT_NODETYPE, NT_PROPERTYDEFINITION, NT_QUERY, NT_RESOURCE, NT_UNSTRUCTURED, NT_VERSION, NT_VERSIONEDCHILD, NT_VERSIONHISTORY, NT_VERSIONLABELS
 
Constructor Summary
DavResourceImpl(DavResourceLocator locator, DavResourceFactory factory, DavSession session, ResourceConfig config)
          Deprecated.  
DavResourceImpl(DavResourceLocator locator, DavResourceFactory factory, DavSession session, ResourceConfig config, boolean isCollection)
          Create a new DavResource.
DavResourceImpl(DavResourceLocator locator, DavResourceFactory factory, DavSession session, ResourceConfig config, javax.jcr.Node node)
          Create a new DavResource.
 
Method Summary
 void addLockManager(LockManager lockMgr)
           
 void addMember(DavResource member, InputContext inputContext)
          Adds a new member to this resource.
 MultiStatusResponse alterProperties(DavPropertySet setProperties, DavPropertyNameSet removePropertyNames)
           
 MultiStatusResponse alterProperties(List changeList)
           
 void bind(DavResource collection, DavResource newBinding)
           
 void copy(DavResource destination, boolean shallow)
           
 boolean exists()
           
 DavResource getCollection()
           
 String getComplianceClass()
           
 String getDisplayName()
          Returns the the last segment of the resource path.
protected  ExportContext getExportContext(OutputContext outputCtx)
          Returns a new ExportContext
 DavResourceFactory getFactory()
           
 String getHref()
           
protected  ImportContext getImportContext(InputContext inputCtx, String systemId)
          Returns a new ImportContext
 DavResourceLocator getLocator()
           
 ActiveLock getLock(Type type, Scope scope)
           
 ActiveLock[] getLocks()
           
 DavResourceIterator getMembers()
           
 long getModificationTime()
           
protected  javax.jcr.Node getNode()
          Returns the node that is wrapped by this resource.
 Set getParentElements()
           
 DavPropertySet getProperties()
           
 DavProperty getProperty(DavPropertyName name)
           
protected  PropertyExportContext getPropertyExportContext()
          Returns a new PropertyExportContext.
protected  PropertyImportContext getPropertyImportContext(List changeList)
          Returns a new PropertyImportContext.
 DavPropertyName[] getPropertyNames()
           
 String getResourcePath()
           
 DavSession getSession()
           
 String getSupportedMethods()
           
 boolean hasLock(Type type, Scope scope)
           
protected  void initProperties()
          Fill the set of properties
 boolean isCollection()
           
 boolean isLockable(Type type, Scope scope)
           
 ActiveLock lock(LockInfo lockInfo)
           
 void move(DavResource destination)
           
 void rebind(DavResource collection, DavResource newBinding)
           
 ActiveLock refreshLock(LockInfo lockInfo, String lockToken)
           
 void removeMember(DavResource member)
           
 void removeProperty(DavPropertyName propertyName)
           
 void setProperty(DavProperty property)
           
 void spool(OutputContext outputContext)
          If this resource exists and the specified context is not null this implementation build a new ExportContext based on the specified context and forwards the export to its IOManager.
 void unlock(String lockToken)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

METHODS

public static final String METHODS
See Also:
Constant Field Values

COMPLIANCE_CLASSES

public static final String COMPLIANCE_CLASSES

properties

protected DavPropertySet properties

propsInitialized

protected boolean propsInitialized
Constructor Detail

DavResourceImpl

public DavResourceImpl(DavResourceLocator locator,
                       DavResourceFactory factory,
                       DavSession session,
                       ResourceConfig config)
                throws DavException
Deprecated. 

Create a new DavResource.

Parameters:
locator -
factory -
session -
Throws:
DavException

DavResourceImpl

public DavResourceImpl(DavResourceLocator locator,
                       DavResourceFactory factory,
                       DavSession session,
                       ResourceConfig config,
                       boolean isCollection)
                throws DavException
Create a new DavResource.

Parameters:
locator -
factory -
session -
config -
isCollection -
Throws:
DavException

DavResourceImpl

public DavResourceImpl(DavResourceLocator locator,
                       DavResourceFactory factory,
                       DavSession session,
                       ResourceConfig config,
                       javax.jcr.Node node)
                throws DavException
Create a new DavResource.

Parameters:
locator -
factory -
session -
config -
node -
Throws:
DavException
Method Detail

getComplianceClass

public String getComplianceClass()
Specified by:
getComplianceClass in interface DavResource
See Also:
DavResource.getComplianceClass()

getSupportedMethods

public String getSupportedMethods()
Specified by:
getSupportedMethods in interface DavResource
Returns:
DavResource#METHODS
See Also:
DavResource.getSupportedMethods()

exists

public boolean exists()
Specified by:
exists in interface DavResource
See Also:
)

isCollection

public boolean isCollection()
Specified by:
isCollection in interface DavResource
See Also:
DavResource.isCollection()

getLocator

public DavResourceLocator getLocator()
Specified by:
getLocator in interface DavResource
See Also:
DavResource.getLocator()

getResourcePath

public String getResourcePath()
Specified by:
getResourcePath in interface DavResource
See Also:
DavResource.getResourcePath()

getHref

public String getHref()
Specified by:
getHref in interface DavResource
See Also:
DavResource.getHref()

getDisplayName

public String getDisplayName()
Returns the the last segment of the resource path.

Note that this must not correspond to the name of the underlying repository item for two reasons:

Using the item name as DAV:displayname caused problems with XP built-in client in case of resources representing SameNameSibling nodes.

Specified by:
getDisplayName in interface DavResource
See Also:
DavResource.getDisplayName()

getModificationTime

public long getModificationTime()
Specified by:
getModificationTime in interface DavResource
See Also:
DavResource.getModificationTime()

spool

public void spool(OutputContext outputContext)
           throws IOException
If this resource exists and the specified context is not null this implementation build a new ExportContext based on the specified context and forwards the export to its IOManager. If the IOManager.exportContent(ExportContext, DavResource) fails, an IOException is thrown.

Specified by:
spool in interface DavResource
Throws:
IOException - if the export fails.
See Also:
DavResource.spool(OutputContext), ResourceConfig.getIOManager()

getProperty

public DavProperty getProperty(DavPropertyName name)
Specified by:
getProperty in interface DavResource
See Also:
DavResource.getProperty(org.apache.jackrabbit.webdav.property.DavPropertyName)

getProperties

public DavPropertySet getProperties()
Specified by:
getProperties in interface DavResource
See Also:
DavResource.getProperties()

getPropertyNames

public DavPropertyName[] getPropertyNames()
Specified by:
getPropertyNames in interface DavResource
See Also:
DavResource.getPropertyNames()

initProperties

protected void initProperties()
Fill the set of properties


setProperty

public void setProperty(DavProperty property)
                 throws DavException
Specified by:
setProperty in interface DavResource
Parameters:
property -
Throws:
DavException
See Also:
DavResource.setProperty(org.apache.jackrabbit.webdav.property.DavProperty)

removeProperty

public void removeProperty(DavPropertyName propertyName)
                    throws DavException
Specified by:
removeProperty in interface DavResource
Parameters:
propertyName -
Throws:
DavException
See Also:
DavResource.removeProperty(org.apache.jackrabbit.webdav.property.DavPropertyName)

alterProperties

public MultiStatusResponse alterProperties(DavPropertySet setProperties,
                                           DavPropertyNameSet removePropertyNames)
                                    throws DavException
Specified by:
alterProperties in interface DavResource
Throws:
DavException
See Also:
DavResource.alterProperties(DavPropertySet, DavPropertyNameSet)

alterProperties

public MultiStatusResponse alterProperties(List changeList)
                                    throws DavException
Specified by:
alterProperties in interface DavResource
Throws:
DavException

getCollection

public DavResource getCollection()
Specified by:
getCollection in interface DavResource
See Also:
DavResource.getCollection()

getMembers

public DavResourceIterator getMembers()
Specified by:
getMembers in interface DavResource
See Also:
DavResource.getMembers()

addMember

public void addMember(DavResource member,
                      InputContext inputContext)
               throws DavException
Adds a new member to this resource.

Specified by:
addMember in interface DavResource
Throws:
DavException
See Also:
DavResource.addMember(DavResource, org.apache.jackrabbit.webdav.io.InputContext)

removeMember

public void removeMember(DavResource member)
                  throws DavException
Specified by:
removeMember in interface DavResource
Throws:
DavException
See Also:
DavResource.removeMember(DavResource)

move

public void move(DavResource destination)
          throws DavException
Specified by:
move in interface DavResource
Throws:
DavException
See Also:
DavResource.move(DavResource)

copy

public void copy(DavResource destination,
                 boolean shallow)
          throws DavException
Specified by:
copy in interface DavResource
Throws:
DavException
See Also:
DavResource.copy(DavResource, boolean)

isLockable

public boolean isLockable(Type type,
                          Scope scope)
Specified by:
isLockable in interface DavResource
Parameters:
type -
scope -
Returns:
true if type is Type.WRITE and scope is Scope.EXCLUSIVE
See Also:
DavResource.isLockable(org.apache.jackrabbit.webdav.lock.Type, org.apache.jackrabbit.webdav.lock.Scope)

hasLock

public boolean hasLock(Type type,
                       Scope scope)
Specified by:
hasLock in interface DavResource
See Also:
DavResource.hasLock(org.apache.jackrabbit.webdav.lock.Type, org.apache.jackrabbit.webdav.lock.Scope)

getLock

public ActiveLock getLock(Type type,
                          Scope scope)
Specified by:
getLock in interface DavResource
See Also:
DavResource.getLock(Type, Scope)

getLocks

public ActiveLock[] getLocks()
Specified by:
getLocks in interface DavResource
See Also:
DavResource.getLocks()

lock

public ActiveLock lock(LockInfo lockInfo)
                throws DavException
Specified by:
lock in interface DavResource
Throws:
DavException
See Also:
DavResource.lock(LockInfo)

refreshLock

public ActiveLock refreshLock(LockInfo lockInfo,
                              String lockToken)
                       throws DavException
Specified by:
refreshLock in interface DavResource
Throws:
DavException
See Also:
DavResource.refreshLock(LockInfo, String)

unlock

public void unlock(String lockToken)
            throws DavException
Specified by:
unlock in interface DavResource
Throws:
DavException
See Also:
DavResource.unlock(String)

addLockManager

public void addLockManager(LockManager lockMgr)
Specified by:
addLockManager in interface DavResource
See Also:
DavResource.addLockManager(org.apache.jackrabbit.webdav.lock.LockManager)

getFactory

public DavResourceFactory getFactory()
Specified by:
getFactory in interface DavResource
See Also:
DavResource.getFactory()

getSession

public DavSession getSession()
Specified by:
getSession in interface DavResource
See Also:
DavResource.getSession()

bind

public void bind(DavResource collection,
                 DavResource newBinding)
          throws DavException
Specified by:
bind in interface BindableResource
Throws:
DavException
See Also:
BindableResource.rebind(DavResource, DavResource)

rebind

public void rebind(DavResource collection,
                   DavResource newBinding)
            throws DavException
Specified by:
rebind in interface BindableResource
Throws:
DavException
See Also:
BindableResource.rebind(DavResource, DavResource)

getParentElements

public Set getParentElements()
Specified by:
getParentElements in interface BindableResource
See Also:
BindableResource.getParentElements()

getNode

protected javax.jcr.Node getNode()
Returns the node that is wrapped by this resource.

Returns:
The underlying JCR node instance.

getImportContext

protected ImportContext getImportContext(InputContext inputCtx,
                                         String systemId)
                                  throws IOException
Returns a new ImportContext

Parameters:
inputCtx -
systemId -
Returns:
a new ImportContext
Throws:
IOException

getExportContext

protected ExportContext getExportContext(OutputContext outputCtx)
                                  throws IOException
Returns a new ExportContext

Parameters:
outputCtx -
Returns:
a new ExportContext
Throws:
IOException

getPropertyImportContext

protected PropertyImportContext getPropertyImportContext(List changeList)
Returns a new PropertyImportContext.

Parameters:
changeList -
Returns:
a new PropertyImportContext.

getPropertyExportContext

protected PropertyExportContext getPropertyExportContext()
Returns a new PropertyExportContext.

Returns:
a new PropertyExportContext


Copyright © 2004-2013 The Apache Software Foundation. All Rights Reserved.