public CmsRepositoryLockInfo getLock(String path) {

        try {
            CmsRepositoryLockInfo lockInfo = new CmsRepositoryLockInfo();

            path = validatePath(path);

            CmsResource res = m_cms.readResource(path, CmsResourceFilter.DEFAULT);

            // check user locks
            CmsLock cmsLock = m_cms.getLock(res);
            if (!cmsLock.isUnlocked()) {
                lockInfo.setPath(path);

                CmsUser owner = m_cms.readUser(cmsLock.getUserId());
                if (owner != null) {
                    lockInfo.setUsername(owner.getName());
                    lockInfo.setOwner(owner.getName() + "||" + owner.getEmail());
                }
                return lockInfo;
            }

            return null;
        } catch (CmsException ex) {

            // error occurred while finding locks
            // return null (no lock found)
            return null;
        }
    }
public CmsRepositoryLockInfo getLock ( String path ) { try { CmsRepositoryLockInfo lockInfo = new CmsRepositoryLockInfo ( ) ; path = validatePath ( path ) ; CmsResource res = m_cms . readResource ( path , CmsResourceFilter . DEFAULT ) ; CmsLock cmsLock = m_cms . getLock ( res ) ; if ( ! cmsLock . isUnlocked ( ) ) { lockInfo . setPath ( path ) ; CmsUser owner = m_cms . readUser ( cmsLock . getUserId ( ) ) ; if ( owner != null ) { lockInfo . setUsername ( owner . getName ( ) ) ; lockInfo . setOwner ( owner . getName ( ) + "||" + owner . getEmail ( ) ) ; } return lockInfo ; } return null ; } catch ( CmsException ex ) { return null ; } }
@see org.opencms.repository.I_CmsRepositorySession#getLock(java.lang.String)