本文整理汇总了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;
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:20,代码来源:ArchivaDavResource.java示例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 );
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:19,代码来源:DavResourceTest.java示例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 );
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:21,代码来源:DavResourceTest.java示例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 );
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:25,代码来源:DavResourceTest.java示例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();
}
}
开发者ID:wso2,项目名称:carbon-registry,代码行数:18,代码来源:RegistryResource.java示例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 );
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:12,代码来源:DavResourceTest.java示例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 ) );
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:16,代码来源:DavResourceTest.java示例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();
}
}
开发者ID:wso2,项目名称:carbon-registry,代码行数:13,代码来源:RegistryResource.java示例9: lock
import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
@Override
public ActiveLock lock( LockInfo arg0 )
throws DavException
{
return null;
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:7,代码来源:ArchivaVirtualDavResource.java示例10: refreshLock
import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
@Override
public ActiveLock refreshLock( LockInfo arg0, String arg1 )
throws DavException
{
return null;
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:7,代码来源:ArchivaVirtualDavResource.java示例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 );
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:19,代码来源:DavResourceTest.java示例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 );
}
开发者ID:ruikom,项目名称:apache-archiva,代码行数:19,代码来源:DavResourceTest.java示例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 );
}
开发者ID:openCage,项目名称:niodav,代码行数:7,代码来源:DavPath.java示例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 );
}
开发者ID:openCage,项目名称:niodav,代码行数:7,代码来源:DavPath.java示例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");
}
开发者ID:1and1,项目名称:cosmo,代码行数:6,代码来源:DavResourceBase.java本文标签属性:
示例:示例英文
代码:代码大全可复制
java:javascript18岁
LockInfo:LockInfo