|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2012-03-24 11:02:40
|
Revision: 482
http://sword-app.svn.sourceforge.net/sword-app/?rev=482&view=rev
Author: richard-jones
Date: 2012-03-24 11:02:34 +0000 (Sat, 24 Mar 2012)
Log Message:
-----------
add syntactic sugar for get, put, delete on arbitrary uris with support for sword headers, as per 6.10 and 6.11)
Modified Paths:
--------------
JavaClient2.0/src/main/java/org/swordapp/client/SWORDClient.java
Modified: JavaClient2.0/src/main/java/org/swordapp/client/SWORDClient.java
===================================================================
--- JavaClient2.0/src/main/java/org/swordapp/client/SWORDClient.java 2012-03-23 15:58:14 UTC (rev 481)
+++ JavaClient2.0/src/main/java/org/swordapp/client/SWORDClient.java 2012-03-24 11:02:34 UTC (rev 482)
@@ -911,6 +911,31 @@
}
}
+ // These methods are syntactic sugar for speaking to individual files if such an operation
+ // is supported by the server. They re-use existing calls (e.g. to getContent or replaceMedia)
+ // but with the URLs of the file resource rather than those of the standard sword urls
+ // (see sections 6.10 and 6.11 of the spec)
+
+ Content getFile(String url, String mimeType, AuthCredentials auth)
+ throws SWORDClientException, ProtocolViolationException, SWORDError
+ {
+ return this.getContent(url, mimeType, null, auth);
+ }
+
+ SwordResponse replaceFile(String url, Deposit deposit, AuthCredentials auth)
+ throws SWORDClientException, ProtocolViolationException, SWORDError
+ {
+ return this.replaceMedia(url, deposit, auth);
+ }
+
+ SwordResponse deleteFile(String url, AuthCredentials auth)
+ throws SWORDClientException, ProtocolViolationException, SWORDError
+ {
+ return this.delete(url, auth);
+ }
+
+ /////////////////////////////////////////////////////////////////////////////////////////
+
public DepositReceipt complete(DepositReceipt receipt, AuthCredentials auth)
throws SWORDClientException, ProtocolViolationException, SWORDError
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|