Class WebdavPrincipalNode
- java.lang.Object
-
- org.bedework.webdav.servlet.shared.WebdavNsNode
-
- org.bedework.webdav.servlet.shared.WebdavPrincipalNode
-
- All Implemented Interfaces:
Serializable,org.bedework.util.logging.Logged
public class WebdavPrincipalNode extends WebdavNsNode
Class to represent a principal in webdav.- Author:
- Mike Douglass douglm rpi.edu
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.bedework.webdav.servlet.shared.WebdavNsNode
WebdavNsNode.PropertyTagEntry, WebdavNsNode.PropVal, WebdavNsNode.SetPropertyResult
-
-
Field Summary
-
Fields inherited from class org.bedework.webdav.servlet.shared.WebdavNsNode
alias, allowsGet, collection, exists, groupPrincipal, path, status, targetUri, uri, urlHandler, userPrincipal, wdSysIntf
-
-
Constructor Summary
Constructors Constructor Description WebdavPrincipalNode(WdSysIntf sysi, UrlHandler urlHandler, String path, org.bedework.access.AccessPrincipal account, boolean collection, String uri)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowsSyncReport()booleangeneratePropertyValue(QName tag, WebdavNsIntf intf, boolean allProp)Emit the property indicated by the tag.Collection<? extends WdEntity<?>>getChildren(Supplier<Object> filterGetter)Return a collection of children objects.WdCollection<?>getCollection(boolean deref)The node may refer to a collection object which may in fact be an alias to another.booleangetContentBinary()StringgetContentLang()longgetContentLen()StringgetContentType()A content type of null implies no content (or we don't know)StringgetCreDate()org.bedework.access.CurrentAccessgetCurrentAccess()Get the current access granted to this principal for this node.booleangetDeleted()StringgetDisplayname()StringgetEtagValue(boolean strong)Entity tags are defined in RFC2068 - they are supposed to provide some sort of indication the data has changed - e.g.WdCollection<?>getImmediateTargetCollection()StringgetLastmodDate()org.bedework.util.logging.BwLoggergetLogger()org.bedework.access.AccessPrincipalgetOwner()Should return a value suitable for WebdavNsIntf.makeUserHrefStringgetSyncToken()booleanknownProperty(QName tag)Return true if a call to generatePropertyValue will return a value.booleanremoveProperty(Element val, WebdavNsNode.SetPropertyResult spr)Remove the given property for this node.booleansetProperty(Element val, WebdavNsNode.SetPropertyResult spr)Set the given property for this node.booleantrailSlash()Trailing "/" on uri?voidupdate()Update this node after changes.StringwriteContent(org.bedework.util.xml.XmlEmit xml, Writer wtr, String contentType)Called during xml emission to write the content for the node.-
Methods inherited from class org.bedework.webdav.servlet.shared.WebdavNsNode
addPropEntry, addPropEntry, equals, generateHref, generateHref, generateUrl, getAlias, getAllowsGet, getContent, getContentStream, getContentString, getEncodedUri, getEncodedUri, getExists, getPath, getPrefixedUri, getPrefixedUri, getPropertyNames, getStatus, getSupportedReports, getTargetUri, getUri, hashCode, init, isCollection, isPrincipal, setAlias, setAllowsGet, setDefaults, setExists, setStatus, setTargetUri, setUri
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.bedework.util.logging.Logged
audit, debug, debug, enableAuditLogger, enableErrorLogger, enableMetricsLogger, error, error, error, getLogLevel, info, isAuditLoggerEnabled, isErrorLoggerEnabled, isMetricsDebugEnabled, isMetricsLoggerEnabled, metrics, setLoggerClass, setLoggerClass, trace, trace, warn
-
-
-
-
Constructor Detail
-
WebdavPrincipalNode
public WebdavPrincipalNode(WdSysIntf sysi, UrlHandler urlHandler, String path, org.bedework.access.AccessPrincipal account, boolean collection, String uri)
- Parameters:
sysi- system interfaceurlHandler- - needed for building hrefs.path- - resource pathaccount- - the principalcollection- - true if this is a collectionuri- of request
-
-
Method Detail
-
getOwner
public org.bedework.access.AccessPrincipal getOwner() throws WebdavExceptionDescription copied from class:WebdavNsNodeShould return a value suitable for WebdavNsIntf.makeUserHref- Specified by:
getOwnerin classWebdavNsNode- Returns:
- AccessPrincipal owner
- Throws:
WebdavException
-
update
public void update() throws WebdavExceptionDescription copied from class:WebdavNsNodeUpdate this node after changes.- Specified by:
updatein classWebdavNsNode- Throws:
WebdavException
-
getCurrentAccess
public org.bedework.access.CurrentAccess getCurrentAccess() throws WebdavExceptionDescription copied from class:WebdavNsNodeGet the current access granted to this principal for this node.- Specified by:
getCurrentAccessin classWebdavNsNode- Returns:
- CurrentAccess
- Throws:
WebdavException
-
getEtagValue
public String getEtagValue(boolean strong) throws WebdavException
Description copied from class:WebdavNsNodeEntity tags are defined in RFC2068 - they are supposed to provide some sort of indication the data has changed - e.g. a checksum.There are weak and strong tags
This methods should return a suitable value for that tag.
- Specified by:
getEtagValuein classWebdavNsNode- Returns:
- String
- Throws:
WebdavException
-
trailSlash
public boolean trailSlash()
Description copied from class:WebdavNsNodeTrailing "/" on uri?- Specified by:
trailSlashin classWebdavNsNode- Returns:
- boolean
-
getChildren
public Collection<? extends WdEntity<?>> getChildren(Supplier<Object> filterGetter) throws WebdavException
Description copied from class:WebdavNsNodeReturn a collection of children objects. For example, this is object represents a folder, they may be file objects or a mix of file and folder objects. These are not node objects.Default is to return null
- Specified by:
getChildrenin classWebdavNsNode- Parameters:
filterGetter- non-null if there is a filter- Returns:
- Collection of children
- Throws:
WebdavException- on fatal error
-
getCollection
public WdCollection<?> getCollection(boolean deref) throws WebdavException
Description copied from class:WebdavNsNodeThe node may refer to a collection object which may in fact be an alias to another. For deletions we want to remove the alias itself.Move and rename are also targetted at the alias.
Other operations are probably intended to work on the underlying target of the alias.
- Specified by:
getCollectionin classWebdavNsNode- Parameters:
deref- true if we want to act upon the target of an alias.- Returns:
- Collection this node represents
- Throws:
WebdavException
-
getImmediateTargetCollection
public WdCollection<?> getImmediateTargetCollection() throws WebdavException
- Specified by:
getImmediateTargetCollectionin classWebdavNsNode- Throws:
WebdavException
-
allowsSyncReport
public boolean allowsSyncReport() throws WebdavException- Specified by:
allowsSyncReportin classWebdavNsNode- Returns:
- true if this node allows a sync-report.
- Throws:
WebdavException
-
getDeleted
public boolean getDeleted() throws WebdavException- Specified by:
getDeletedin classWebdavNsNode- Returns:
- true if this represents a deleted resource.
- Throws:
WebdavException
-
getSyncToken
public String getSyncToken() throws WebdavException
- Specified by:
getSyncTokenin classWebdavNsNode- Returns:
- String sync-token, a URI
- Throws:
WebdavException
-
writeContent
public String writeContent(org.bedework.util.xml.XmlEmit xml, Writer wtr, String contentType) throws WebdavException
Description copied from class:WebdavNsNodeCalled during xml emission to write the content for the node.- Specified by:
writeContentin classWebdavNsNode- Parameters:
xml- - if this is embedded in an xml streamwtr- - if standalone output or no xml stream initialized.contentType- desired content type or null for default.- Returns:
- actual contentType
- Throws:
WebdavException
-
getContentBinary
public boolean getContentBinary() throws WebdavException- Specified by:
getContentBinaryin classWebdavNsNode- Returns:
- boolean true if this is binary content
- Throws:
WebdavException
-
getContentLang
public String getContentLang() throws WebdavException
- Specified by:
getContentLangin classWebdavNsNode- Returns:
- String lang
- Throws:
WebdavException
-
getContentLen
public long getContentLen() throws WebdavException- Specified by:
getContentLenin classWebdavNsNode- Returns:
- long content length
- Throws:
WebdavException
-
getContentType
public String getContentType() throws WebdavException
Description copied from class:WebdavNsNodeA content type of null implies no content (or we don't know)- Specified by:
getContentTypein classWebdavNsNode- Returns:
- String content type
- Throws:
WebdavException
-
getCreDate
public String getCreDate() throws WebdavException
- Specified by:
getCreDatein classWebdavNsNode- Returns:
- String credate
- Throws:
WebdavException
-
getDisplayname
public String getDisplayname() throws WebdavException
- Specified by:
getDisplaynamein classWebdavNsNode- Returns:
- String name
- Throws:
WebdavException
-
getLastmodDate
public String getLastmodDate() throws WebdavException
- Specified by:
getLastmodDatein classWebdavNsNode- Returns:
- String last mod date
- Throws:
WebdavException
-
removeProperty
public boolean removeProperty(Element val, WebdavNsNode.SetPropertyResult spr) throws WebdavException
Description copied from class:WebdavNsNodeRemove the given property for this node.- Overrides:
removePropertyin classWebdavNsNode- Parameters:
val- Element defining property to removespr- Holds reult of removing property- Returns:
- boolean true if property recognized.
- Throws:
WebdavException
-
setProperty
public boolean setProperty(Element val, WebdavNsNode.SetPropertyResult spr) throws WebdavException
Description copied from class:WebdavNsNodeSet the given property for this node.- Overrides:
setPropertyin classWebdavNsNode- Parameters:
val- Element defining property to setspr- Holds result of setting property- Returns:
- boolean true if property recognized and processed.
- Throws:
WebdavException
-
knownProperty
public boolean knownProperty(QName tag)
Description copied from class:WebdavNsNodeReturn true if a call to generatePropertyValue will return a value.- Overrides:
knownPropertyin classWebdavNsNode- Returns:
- boolean
-
generatePropertyValue
public boolean generatePropertyValue(QName tag, WebdavNsIntf intf, boolean allProp) throws WebdavException
Description copied from class:WebdavNsNodeEmit the property indicated by the tag.- Overrides:
generatePropertyValuein classWebdavNsNode- Parameters:
tag- QName defining propertyintf- WebdavNsIntfallProp- true if we're doing allprop- Returns:
- boolean true if emitted
- Throws:
WebdavException
-
getLogger
public org.bedework.util.logging.BwLogger getLogger()
- Specified by:
getLoggerin interfaceorg.bedework.util.logging.Logged- Overrides:
getLoggerin classWebdavNsNode
-
-