|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsmbdav.SmbDAVUtilities
This class contains static utility methods for the Davenport servlet and its associated classes.
Field Summary | |
static int |
CHILDREN_DEPTH
Depth constant indicating that the operation applies to the targeted resource and its immediate children. |
static int |
INFINITE_DEPTH
Depth constant indicating that the operation applies to the targeted resource and all of its progeny. |
static long |
INFINITE_TIMEOUT
Timeout constant indicating an infinite lock timeout. |
static long |
MAXIMUM_TIMEOUT
Timeout constant representing the maximum lock timeout value. |
static int |
RESOURCE_ONLY_DEPTH
Depth constant indicating that the operation applies only to the targeted resource itself. |
static long |
UNSPECIFIED_TIMEOUT
Timeout constant indicating an unspecified lock timeout. |
Method Summary | |
static java.lang.String |
formatCreationDate(long creation)
Formats a timestamp (representing milliseconds since the epoch) as used in the WebDAV creationdate property. |
static java.lang.String |
formatGetLastModified(long lastModified)
Formats a timestamp (representing milliseconds since the epoch) as used in the WebDAV getlastmodified property. |
static java.lang.String |
formatTimeout(long timeout)
Utility method to format a lock timeout value for use in the "Timeout" header. |
static java.lang.String |
generateUuid()
Generates a UUID, as described in ISO-11578. |
static java.lang.String |
getETag(jcifs.smb.SmbFile file)
Returns the entity tag for the specified resource. |
static java.lang.String |
getResource(java.lang.Class context,
java.lang.String resource,
java.lang.Object[] parameters,
java.util.Locale locale)
Returns the specified resource string value. |
static void |
lockDiscovery(jcifs.smb.SmbFile file,
LockManager lockManager,
org.w3c.dom.Element destination)
Utility method to output the "lockdiscovery" XML for the active locks on the specified SMB resource, as managed by the specified lock manager. |
static int |
parseDepth(java.lang.String depth)
Utility method to parse the "Depth" header. |
static long |
parseTimeout(java.lang.String timeout)
Utility method to parse the "Timeout" header. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int RESOURCE_ONLY_DEPTH
public static final int CHILDREN_DEPTH
public static final int INFINITE_DEPTH
public static final long UNSPECIFIED_TIMEOUT
public static final long INFINITE_TIMEOUT
public static final long MAXIMUM_TIMEOUT
Method Detail |
public static java.lang.String getResource(java.lang.Class context, java.lang.String resource, java.lang.Object[] parameters, java.util.Locale locale)
context
- A class representing the context for the resource
string.resource
- The resource name.parameters
- Substitution parameters for the message.locale
- The desired locale.
String
containing the resource value.public static java.lang.String formatCreationDate(long creation)
creationdate
property.
creation
- The creation timestamp, represented as the number
of milliseconds since midnight, January 1, 1970 UTC.
String
containing the formatted result.public static java.lang.String formatGetLastModified(long lastModified)
getlastmodified
property.
lastModified
- The last modification timestamp, represented
as the number of milliseconds since midnight, January 1, 1970 UTC.
String
containing the formatted result.public static java.lang.String getETag(jcifs.smb.SmbFile file)
file
- The resource whose entity tag is to be retrieved.
String
containing the entity tag for the
resource.public static int parseDepth(java.lang.String depth)
depth
- The value of the WebDAV "Depth" header.
int
containing the depth code. One of
RESOURCE_ONLY_DEPTH
, CHILDREN_DEPTH
, or
INFINITE_DEPTH
.public static java.lang.String formatTimeout(long timeout)
timeout
- The timeout value in milliseconds.
String
containing the formatted timeout
value. If the provided timeout is UNSPECIFIED_TIMEOUT
,
this method returns null
. If the value is
INFINITE_TIMEOUT
, this returns the string
"Infinite
". For all other values, this method returns
a string of the form "Second-nnnn
", where
nnnn
is the timeout value converted to seconds.
If the value is greater than MAXIMUM_TIMEOUT
,
MAXIMUM_TIMEOUT
will be used instead.public static long parseTimeout(java.lang.String timeout)
timeout
- The value of the WebDAV "Timeout" header.
long
containing the timeout value in
milliseconds. UNSPECIFIED_TIMEOUT
indicates no timeout
value was specified or recognized. INFINITE_TIMEOUT
indicates an infinite timeout was requested.public static void lockDiscovery(jcifs.smb.SmbFile file, LockManager lockManager, org.w3c.dom.Element destination) throws java.io.IOException
file
- The SMB resource whose active locks are to be enumerated.lockManager
- The lock manager to examine.destination
- The element under which the active locks will be
enumerated. This would typically be a "lockdiscovery" element.
java.io.IOException
public static java.lang.String generateUuid()
String
containing a globally unique UUID.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |