Ejemplo n.º 1
0
  /** @return true If the lock owner is someone else or if it's a WebDAV lock */
  @Override
  public boolean isLockedForMe(VFSItem item, Identity me, Roles roles) {
    File file = extractFile(item);
    if (file != null && fileLocks.containsKey(file)) {
      LockInfo lock = fileLocks.get(file);
      if (lock != null && lock.hasExpired()) {
        // LOCK resourceLocks.remove(lock.getWebPath());
        fileLocks.remove(file);
      } else {
        Long lockedBy = lock.getLockedBy();
        return (lockedBy != null && !lockedBy.equals(me.getKey())) || lock.isWebDAVLock();
      }
    }

    Long lockedBy = getMetaLockedBy(item);
    return (lockedBy != null && !lockedBy.equals(me.getKey()));
  }