forked from lookfirst/sardine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support RFC 4331: Quota and Size Properties for DAV Collections
- Loading branch information
Alexander Makarov
committed
May 31, 2013
1 parent
e330114
commit 86c89a2
Showing
8 changed files
with
375 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
xjc webdav.xsd -d src/main/java -p com.github.sardine.model -nv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.github.sardine; | ||
|
||
import com.github.sardine.model.Prop; | ||
import com.github.sardine.model.Response; | ||
|
||
/** | ||
* Quota and Size Properties | ||
* | ||
* @author Alexander Makarov | ||
*/ | ||
public class DavQuota { | ||
/** | ||
* The DAV:quota-available-bytes property value is the value in octets | ||
* representing the amount of additional disk space beyond the current | ||
* allocation that can be allocated to this resource before further | ||
* allocations will be refused. | ||
*/ | ||
private final long quotaAvailableBytes; | ||
|
||
/** | ||
* The DAV:quota-used-bytes value is the value in octets representing | ||
* the amount of space used by this resource and possibly a number of | ||
* other similar resources, where the set of "similar" meets at least | ||
* the criterion that allocating space to any resource in the set will | ||
* count against the DAV:quota-available-bytes. | ||
*/ | ||
private final long quotaUsedBytes; | ||
|
||
public DavQuota(Response response) { | ||
Prop prop = response.getPropstat().get(0).getProp(); | ||
this.quotaAvailableBytes = Long.valueOf(prop.getQuotaAvailableBytes().getContent().get(0)); | ||
this.quotaUsedBytes = Long.valueOf(prop.getQuotaUsedBytes().getContent().get(0)); | ||
} | ||
|
||
public long getQuotaAvailableBytes() { | ||
return quotaAvailableBytes; | ||
} | ||
|
||
public long getQuotaUsedBytes() { | ||
return quotaUsedBytes; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.