本文整理汇总了Java中org.apache.jackrabbit.webdav.lock.LockInfo类的典型用法代码示例。如果您正苦于以下问题:Java LockInfo类的具体用法?Java LockInfo怎么用?Java LockInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LockInfo类属于org.apache.jackrabbit.webdav.lock包,在下文中一共展示了LockInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: refreshLock
import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
@Override
public ActiveLock refreshLock( LockInfo lockInfo, String lockToken )
throws DavException
{
if ( !exists() )
{
throw new DavException( DavServletResponse.SC_NOT_FOUND );
}
ActiveLock lock = getLock( lockInfo.getType(), lockInfo.getScope() );
if ( lock == null )
{
throw new DavException( DavServletResponse.SC_PRECONDITION_FAILED,
"No lock with the given type/scope present on resource " + getResourcePath() );
}
lock = lockManager.refreshLock( lockInfo, lockToken, this );
return lock;
}
示例2: testLockIfResourceUnlockable
import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
@Test
public void testLockIfResourceUnlockable()
throws Exception
{
assertEquals( 0, resource.getLocks().length );
LockInfo info = new LockInfo( Scope.SHARED, Type.WRITE, "/", 0, false );
try
{
lockManager.createLock( info, resource );
fail( "Did not throw dav exception" );
}
catch ( Exception e )
{
// Simple lock manager will die
}
assertEquals( 0, resource.getLocks().length );
}
示例3: testRefreshLockThrowsExceptionIfNoLockIsPresent
import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
@Test
public void testRefreshLockThrowsExceptionIfNoLockIsPresent()
throws Exception
{
LockInfo info = new LockInfo( Scope.EXCLUSIVE, Type.WRITE, "/", 0, false );
assertEquals( 0, resource.getLocks().length );
try
{
lockManager.refreshLock( info, "notoken", resource );
fail( "Did not throw dav exception" );
}
catch ( DavException e )
{
assertEquals( DavServletResponse.SC_PRECONDITION_FAILED, e.getErrorCode() );
}
assertEquals( 0, resource.getLocks().length );
}
示例4: testUnlockThrowsDavExceptionIfNotLocked
import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
@Test
public void testUnlockThrowsDavExceptionIfNotLocked()
throws Exception
{
LockInfo info = new LockInfo( Scope.EXCLUSIVE, Type.WRITE, "/", 0, false );
assertEquals( 0, resource.getLocks().length );
lockManager.createLock( info, resource );
assertEquals( 1, resource.getLocks().length );
try
{
lockManager.releaseLock( "BLAH", resource );
fail( "Did not throw DavException" );
}
catch ( DavException e )
{
assertEquals( DavServletResponse.SC_LOCKED, e.getErrorCode() );
}
assertEquals( 1, resource.getLocks().length );
}
示例5: refreshLock
import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
public ActiveLock refreshLock(LockInfo lockInfo, String lockToken) throws DavException{
if(lockable){
if (!exists()) {
throw new DavException(DavServletResponse.SC_NOT_FOUND);
}
ActiveLock lock = getLock(lockInfo.getType(), lockInfo.getScope());
if (lock == null) {
throw new DavException(DavServletResponse.SC_PRECONDITION_FAILED, "No lock with the given type/scope present on resource " + getResourcePath());
}
lock = lockManager.refreshLock(lockInfo, lockToken, this);
/* since lock has infinite lock (simple) or undefined timeout (jcr)
return the lock as retrieved from getLock. */
return lock;
}else{
throw new UnsupportedOperationException();
}
}
示例6: testLock
import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
@Test
public void testLock()
throws Exception
{
assertEquals( 0, resource.getLocks().length );
LockInfo info = new LockInfo( Scope.EXCLUSIVE, Type.WRITE, "/", 0, false );
lockManager.createLock( info, resource );
assertEquals( 1, resource.getLocks().length );
}
示例7: testGetLock
import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
@Test
public void testGetLock()
throws Exception
{
LockInfo info = new LockInfo( Scope.EXCLUSIVE, Type.WRITE, "/", 0, false );
lockManager.createLock( info, resource );
assertEquals( 1, resource.getLocks().length );
// Lock should exist
assertNotNull( resource.getLock( Type.WRITE, Scope.EXCLUSIVE ) );
// Lock should not exist
assertNull( resource.getLock( Type.WRITE, Scope.SHARED ) );
}
示例8: lock
import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
public ActiveLock lock(LockInfo lockInfo) throws DavException {
if(lockable){
if (isLockable(lockInfo.getType(), lockInfo.getScope())) {
return lockManager.createLock(lockInfo, this);
} else {
throw new DavException(DavServletResponse.SC_PRECONDITION_FAILED, "Unsupported lock type or scope.");
}
}else{
throw new UnsupportedOperationException();
}
}
示例9: lock
import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
@Override
public ActiveLock lock( LockInfo arg0 )
throws DavException
{
return null;
}
示例10: refreshLock
import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
@Override
public ActiveLock refreshLock( LockInfo arg0, String arg1 )
throws DavException
{
return null;
}
示例11: testRefreshLock
import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
@Test
public void testRefreshLock()
throws Exception
{
LockInfo info = new LockInfo( Scope.EXCLUSIVE, Type.WRITE, "/", 0, false );
assertEquals( 0, resource.getLocks().length );
lockManager.createLock( info, resource );
assertEquals( 1, resource.getLocks().length );
ActiveLock lock = resource.getLocks()[0];
lockManager.refreshLock( info, lock.getToken(), resource );
assertEquals( 1, resource.getLocks().length );
}
示例12: testUnlock
import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
@Test
public void testUnlock()
throws Exception
{
LockInfo info = new LockInfo( Scope.EXCLUSIVE, Type.WRITE, "/", 0, false );
assertEquals( 0, resource.getLocks().length );
lockManager.createLock( info, resource );
assertEquals( 1, resource.getLocks().length );
ActiveLock lock = resource.getLocks()[0];
lockManager.releaseLock( lock.getToken(), resource );
assertEquals( 0, resource.getLocks().length );
}
示例13: lock
import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
@Override
public
@Nullable
ActiveLock lock( @Nullable LockInfo lockInfo ) throws DavException {
return lockManager.createLock( lockInfo, this );
}
示例14: refreshLock
import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
@Override
public
@Nullable
ActiveLock refreshLock( @Nullable LockInfo lockInfo, @Nullable String lockToken ) throws DavException {
return lockManager.refreshLock( lockInfo, lockToken, this );
}
示例15: lock
import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
public ActiveLock lock(LockInfo reqLockInfo)
throws DavException {
// nothing is lockable at the moment
throw new PreconditionFailedException("Resource not lockable");
}