Performs a WebDAV LOCK request and returns a DAV::Response object.
$resource->lock(
-owner => "Patrick Collins",
-depth => "infinity"
-scope => "exclusive",
-type => "write"
-timeout => TIMEOUT',
)
lock takes the following arguments.
owner - Indicates who locked this resource
The default value is:
DAV.pm/v$DAV::VERSION ($$)
e.g. DAV.pm/v0.1 (123)
If you use a URL as the owner, the module will automatically
indicate to the server that is is a URL
(<D:href>http://...</D:href>)
depth - Indicates the depth of the lock.
Legal values are 0 or infinity. (1 is not allowed).
The default value is infinity.
A lock value of 0 on a collection will lock just the
collection but not it's members, whereas a lock value of infinity will
lock the collection and all of it's members.
scope - Indicates the scope of the lock.
Legal DAV values are "exclusive" or
"shared".
The default value is exclusive.
See section 6.1 of RFC2518 for a description of shared vs.
exclusive locks.
type - Indicates the type of lock (read, write,
etc)
The only legal DAV value currently is "write".
The default value is write.
timeout - Indicates when the lock will timeout
The timeout value may be one of, an Absolute Date, a Time
Offset from now, or the word "infinity".
The default value is "infinity".
The following are all valid timeout values:
Time Offset:
30s 30 seconds from now
10m ten minutes from now
1h one hour from now
1d tomorrow
3M in three months
10y in ten years time
Absolute Date:
timeout at the indicated time & date (UTC/GMT)
2000-02-31 00:40:33
timeout at the indicated date (UTC/GMT)
2000-02-31
You can use any of the Absolute Date formats specified in
HTTP::Date (see perldoc HTTP::Date)
Note: the DAV server may choose to ignore your specified
timeout.
Remove all locks from a resource and return the last DAV::Response object.
This method take no arguments.
$response =
$resource->forcefully_unlock_all;
This method will perform a lockdiscovery against the resource
to determine all of the current locks. Then it will UNLOCK them one by
one. unlock( -token => locktoken ).
This unlock process is achievable because DAV does not enforce
any security over locks.
Note: this method returns the LAST unlock response (this is
sufficient to indicate the success of the sequence of unlocks). If an
unlock fails, it will bail and return that response. For instance, In
the event that there are 3 shared locks and the second unlock method
fails, then you will get returned the unsuccessful second response. The
3rd unlock will not be attempted.
Don't run with this knife, you could hurt someone (or
yourself).