public static HierarchicalProperty lockDiscovery ( String token , String lockOwner , String timeOut ) { HierarchicalProperty lockDiscovery = new HierarchicalProperty ( new QName ( "DAV:" , "lockdiscovery" ) ) ; HierarchicalProperty activeLock = lockDiscovery . addChild ( new HierarchicalProperty ( new QName ( "DAV:" , "activelock" ) ) ) ; HierarchicalProperty lockType = activeLock . addChild ( new HierarchicalProperty ( new QName ( "DAV:" , "locktype" ) ) ) ; lockType . addChild ( new HierarchicalProperty ( new QName ( "DAV:" , "write" ) ) ) ; HierarchicalProperty lockScope = activeLock . addChild ( new HierarchicalProperty ( new QName ( "DAV:" , "lockscope" ) ) ) ; lockScope . addChild ( new HierarchicalProperty ( new QName ( "DAV:" , "exclusive" ) ) ) ; HierarchicalProperty depth = activeLock . addChild ( new HierarchicalProperty ( new QName ( "DAV:" , "depth" ) ) ) ; depth . setValue ( "Infinity" ) ; if ( lockOwner != null ) { HierarchicalProperty owner = activeLock . addChild ( new HierarchicalProperty ( new QName ( "DAV:" , "owner" ) ) ) ; owner . setValue ( lockOwner ) ; } HierarchicalProperty timeout = activeLock . addChild ( new HierarchicalProperty ( new QName ( "DAV:" , "timeout" ) ) ) ; timeout . setValue ( "Second-" + timeOut ) ; if ( token != null ) { HierarchicalProperty lockToken = activeLock . addChild ( new HierarchicalProperty ( new QName ( "DAV:" , "locktoken" ) ) ) ; HierarchicalProperty lockHref = lockToken . addChild ( new HierarchicalProperty ( new QName ( "DAV:" , "href" ) ) ) ; lockHref . setValue ( token ) ; } return lockDiscovery ; }
Returns the information about lock .