Class DavResource
java.lang.Object
com.github.sardine.DavResource
Describes a resource on a remote server. This could be a directory or an actual file.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longThe default content-length ifGetcontentlengthis not set in theMultistatusresponse.static final StringThe default content-type ifGetcontenttypeis not set in theMultistatusresponse.static final intThe default status code ifResponse.getStatus()is not set in theMultistatusresponse.static final Stringcontent-type forCollection. -
Constructor Summary
ConstructorsModifierConstructorDescriptionDavResource(Response response) Converts the givenResponseto aDavResource.protectedDavResource(String href, Date creation, Date modified, String contentType, Long contentLength, String etag, String displayName, String lockToken, List<QName> resourceTypes, String contentLanguage, List<QName> supportedReports, Map<QName, String> customProps) Represents a webdav response block. -
Method Summary
-
Field Details
-
DEFAULT_CONTENT_TYPE
The default content-type ifGetcontenttypeis not set in theMultistatusresponse.- See Also:
-
DEFAULT_CONTENT_LENGTH
public static final long DEFAULT_CONTENT_LENGTHThe default content-length ifGetcontentlengthis not set in theMultistatusresponse.- See Also:
-
HTTPD_UNIX_DIRECTORY_CONTENT_TYPE
-
DEFAULT_STATUS_CODE
public static final int DEFAULT_STATUS_CODEThe default status code ifResponse.getStatus()is not set in theMultistatusresponse.- See Also:
-
-
Constructor Details
-
DavResource
protected DavResource(String href, Date creation, Date modified, String contentType, Long contentLength, String etag, String displayName, String lockToken, List<QName> resourceTypes, String contentLanguage, List<QName> supportedReports, Map<QName, String> customProps) throws URISyntaxExceptionRepresents a webdav response block.- Parameters:
href- URI to the resource as returned from the server- Throws:
URISyntaxException- If parsing the href from the response element fails
-
DavResource
Converts the givenResponseto aDavResource.- Parameters:
response- The response complex type of the multistatus- Throws:
URISyntaxException- If parsing the href from the response element fails
-
-
Method Details
-
getStatusCode
public int getStatusCode()- Returns:
- Status code (or 200 if not present, or -1 if malformed)
-
getCreation
- Returns:
- Timestamp
-
getModified
- Returns:
- Timestamp
-
getContentType
- Returns:
- MIME Type
-
getContentLength
- Returns:
- Size
-
getEtag
- Returns:
- Fingerprint
-
getContentLanguage
- Returns:
- Content language
-
getDisplayName
- Returns:
- Display name
-
getLockToken
- Returns:
- Lock Token
-
getResourceTypes
-
getSupportedReports
-
isDirectory
public boolean isDirectory()Implementation assumes that every resource with a content type ofhttpd/unix-directoryis a directory.- Returns:
- True if this resource denotes a directory
-
getCustomProps
-
getCustomPropsNS
-
getHref
- Returns:
- URI of the resource.
-
getName
Last path component.- Returns:
- The name of the resource URI decoded.
- See Also:
-
getPath
- Returns:
- Path component of the URI of the resource.
- See Also:
-
toString
-