/** * Returns true if this a lock with the given type and scope is supported. * * @param type * @param scope * @return true if applying a lock with the given type and scope is basically * supported. */ public boolean isSupportedLock(Type type, Scope scope) { for (LockEntry le : entries) { if (le.getType().equals(type) && le.getScope().equals(scope)) { return true; } } return false; }
/** * Creates a JDOM element that represents the <supportedlock> tag. * * @return A JDOM element of this lock support. * @param document */ public Element toXml(Document document) { Element support = getName().toXml(document); Iterator iter = entries.iterator(); while (iter.hasNext()) { LockEntry le = (LockEntry) iter.next(); support.appendChild(le.toXml(document)); } return support; }
/** * Creates an XML element that represents the <supportedlock> tag. * * @return An XML element of this lock support. * @param document */ @Override public Element toXml(Document document) { Element support = getName().toXml(document); for (LockEntry le : entries) { support.appendChild(le.toXml(document)); } return support; }
/** * Returns true if this a lock with the given type and scope is supported. * * @param type * @param scope * @return true if applying a lock with the given type and scope is basically * supported. */ public boolean isSupportedLock(Type type, Scope scope) { for (LockEntry le : entries) { if (le.getType().equals(type) && le.getScope().equals(scope)) { return true; } } return false; }
/** * Creates an XML element that represents the <supportedlock> tag. * * @return An XML element of this lock support. * @param document */ @Override public Element toXml(Document document) { Element support = getName().toXml(document); for (LockEntry le : entries) { support.appendChild(le.toXml(document)); } return support; }
/** * Returns true if this a lock with the given type and scope is supported. * * @param type * @param scope * @return true if applying a lock with the given type and scope is basically * supported. */ public boolean isSupportedLock(Type type, Scope scope) { Iterator it = entries.iterator(); while (it.hasNext()) { LockEntry le = (LockEntry) it.next(); if (le.getType().equals(type) && le.getScope().equals(scope)) { return true; } } return false; }
/** * Gets all the active locks on this resource. * * @return An array of {@link org.apache.jackrabbit.webdav.lock.ActiveLock} instances representing the locks on this * resource. */ public ActiveLock[] getLocks() { SupportedLock supportedLock = getSupportedLock(); if (null != supportedLock) { List<ActiveLock> activeLocks = new ArrayList<ActiveLock>(); for (final Iterator i = supportedLock.getSupportedLocks(); i.hasNext(); ) { LockEntry lockEntry = (LockEntry) i.next(); ActiveLock activeLock = getLock(lockEntry.getType(), lockEntry.getScope()); if (null != activeLock) activeLocks.add(activeLock); } return activeLocks.toArray(new ActiveLock[activeLocks.size()]); } return new ActiveLock[0]; }