Example usage for com.liferay.portal.kernel.repository.model FileEntry hasLock

List of usage examples for com.liferay.portal.kernel.repository.model FileEntry hasLock

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.repository.model FileEntry hasLock.

Prototype

public boolean hasLock();

Source Link

Usage

From source file:com.liferay.document.library.web.internal.webdav.DLWebDAVStorageImpl.java

License:Open Source License

protected boolean hasLock(FileEntry fileEntry, String lockUuid) throws Exception {

    if (Validator.isNull(lockUuid)) {

        // Client does not claim to know of a lock

        return fileEntry.hasLock();
    } else {/*from  w w w . j  a  v a2  s  . com*/

        // Client claims to know of a lock. Verify the lock UUID.

        try {
            return _dlAppService.verifyFileEntryLock(fileEntry.getRepositoryId(), fileEntry.getFileEntryId(),
                    lockUuid);
        } catch (NoSuchLockException nsle) {
            if (_log.isDebugEnabled()) {
                _log.debug(nsle, nsle);
            }

            return false;
        }
    }
}

From source file:com.liferay.portlet.documentlibrary.webdav.DLWebDAVStorageImpl.java

License:Open Source License

protected boolean hasLock(FileEntry fileEntry, String lockUuid) throws Exception {

    if (Validator.isNull(lockUuid)) {

        // Client does not claim to know of a lock

        return fileEntry.hasLock();
    } else {//w  ww  .  java2  s.c  o m

        // Client claims to know of a lock. Verify the lock UUID.

        try {
            return DLAppServiceUtil.verifyFileEntryLock(fileEntry.getRepositoryId(), fileEntry.getFileEntryId(),
                    lockUuid);
        } catch (NoSuchLockException nsle) {
            return false;
        }
    }
}