chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1423147 [1/2] - in /chemistry/opencmis/trunk: chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ chemistry-opencmis-client/chemistry-opencmis-client-binding...
Date Mon, 17 Dec 2012 21:13:01 GMT
Author: fmui
Date: Mon Dec 17 21:12:52 2012
New Revision: 1423147

URL: http://svn.apache.org/viewvc?rev=1423147&view=rev
Log:
CMIS-291, CMIS-564, CMIS-615: HTTP client implementation is now plugable

Added:
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/http/DefaultHttpInvoker.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/http/HttpInvoker.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/http/Output.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/http/Response.java
Removed:
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/http/HttpUtils.java
Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java
    chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/DiscoveryServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/MultiFilingServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/NavigationServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/PolicyServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/RelationshipServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/RepositoryServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/VersioningServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/CmisBindingFactory.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/CmisBindingsHelper.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AtomEntryWriter.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/DiscoveryServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/MultiFilingServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/NavigationServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/PolicyServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/RelationshipServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/RepositoryServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/VersioningServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/AbstractBrowserBindingService.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/AclServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/DiscoveryServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/MultiFilingServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/NavigationServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/ObjectServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/PolicyServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/RelationshipServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/RepositoryServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/VersioningServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/SessionParameter.java
    chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/AbstractCmisService.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java?rev=1423147&r1=1423146&r2=1423147&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java Mon Dec 17 21:12:52 2012
@@ -28,6 +28,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.chemistry.opencmis.client.bindings.impl.CmisBindingsHelper;
 import org.apache.chemistry.opencmis.client.bindings.spi.BindingSession;
 import org.apache.chemistry.opencmis.client.bindings.spi.LinkAccess;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomAcl;
@@ -37,7 +38,9 @@ import org.apache.chemistry.opencmis.cli
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomLink;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.RepositoryWorkspace;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.ServiceDoc;
-import org.apache.chemistry.opencmis.client.bindings.spi.http.HttpUtils;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.HttpInvoker;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Output;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Response;
 import org.apache.chemistry.opencmis.commons.PropertyIds;
 import org.apache.chemistry.opencmis.commons.SessionParameter;
 import org.apache.chemistry.opencmis.commons.data.Ace;
@@ -107,6 +110,13 @@ public abstract class AbstractAtomPubSer
     }
 
     /**
+     * Gets the HTTP Invoker object.
+     */
+    protected HttpInvoker getHttpInvoker() {
+        return CmisBindingsHelper.getHttpInvoker(session);
+    }    
+    
+    /**
      * Returns the service document URL of this session.
      */
     protected String getServiceDocURL() {
@@ -538,10 +548,10 @@ public abstract class AbstractAtomPubSer
      * Performs a GET on an URL, checks the response code and returns the
      * result.
      */
-    protected HttpUtils.Response read(UrlBuilder url) {
+    protected Response read(UrlBuilder url) {
         // make the call
         //Log.d("URL", url.toString());
-        HttpUtils.Response resp = HttpUtils.invokeGET(url, session);
+        Response resp = getHttpInvoker().invokeGET(url, session);
 
         // check response code
         if (resp.getResponseCode() != 200) {
@@ -555,10 +565,10 @@ public abstract class AbstractAtomPubSer
      * Performs a POST on an URL, checks the response code and returns the
      * result.
      */
-    protected HttpUtils.Response post(UrlBuilder url, String contentType, HttpUtils.Output writer) {
+    protected Response post(UrlBuilder url, String contentType, Output writer) {
         // make the call
         //Log.d("URL", url.toString());
-        HttpUtils.Response resp = HttpUtils.invokePOST(url, contentType, writer, session);
+        Response resp = getHttpInvoker().invokePOST(url, contentType, writer, session);
 
         // check response code
         if (resp.getResponseCode() != 201) {
@@ -572,7 +582,7 @@ public abstract class AbstractAtomPubSer
      * Performs a PUT on an URL, checks the response code and returns the
      * result.
      */
-    protected HttpUtils.Response put(UrlBuilder url, String contentType, HttpUtils.Output writer) {
+    protected Response put(UrlBuilder url, String contentType, Output writer) {
         return put(url, contentType, null, writer);
     }
 
@@ -580,11 +590,11 @@ public abstract class AbstractAtomPubSer
      * Performs a PUT on an URL, checks the response code and returns the
      * result.
      */
-    protected HttpUtils.Response put(UrlBuilder url, String contentType, Map<String, String> headers,
-            HttpUtils.Output writer) {
+    protected Response put(UrlBuilder url, String contentType, Map<String, String> headers,
+            Output writer) {
         // make the call
         //Log.d("URL", url.toString());
-        HttpUtils.Response resp = HttpUtils.invokePUT(url, contentType, headers, writer, session);
+        Response resp = getHttpInvoker().invokePUT(url, contentType, headers, writer, session);
 
         // check response code
         if ((resp.getResponseCode() < 200) || (resp.getResponseCode() > 299)) {
@@ -601,7 +611,7 @@ public abstract class AbstractAtomPubSer
     protected void delete(UrlBuilder url) {
         // make the call
         //Log.d("URL", url.toString());
-        HttpUtils.Response resp = HttpUtils.invokeDELETE(url, session);
+        Response resp = getHttpInvoker().invokeDELETE(url, session);
 
         // check response code
         if (resp.getResponseCode() != 204) {
@@ -712,7 +722,7 @@ public abstract class AbstractAtomPubSer
         url.addParameter(Constants.PARAM_REPOSITORY_ID, repositoryId);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         ServiceDoc serviceDoc = parse(resp.getStream(), ServiceDoc.class);
 
         // walk through the workspaces
@@ -772,7 +782,7 @@ public abstract class AbstractAtomPubSer
         }
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         AtomEntry entry = parse(resp.getStream(), AtomEntry.class);
 
         // we expect a CMIS entry
@@ -815,7 +825,7 @@ public abstract class AbstractAtomPubSer
         }
 
         // read and parse
-        HttpUtils.Response resp = read(new UrlBuilder(link));
+        Response resp = read(new UrlBuilder(link));
         AtomEntry entry = parse(resp.getStream(), AtomEntry.class);
 
         // we expect a CMIS entry
@@ -861,7 +871,7 @@ public abstract class AbstractAtomPubSer
         url.addParameter(Constants.PARAM_ONLY_BASIC_PERMISSIONS, onlyBasicPermissions);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         AtomAcl acl = parse(resp.getStream(), AtomAcl.class);
 
         return acl.getACL();
@@ -883,7 +893,7 @@ public abstract class AbstractAtomPubSer
         aclUrl.addParameter(Constants.PARAM_ACL_PROPAGATION, aclPropagation);
 
         // update
-        HttpUtils.Response resp = put(aclUrl, Constants.MEDIATYPE_ACL, new HttpUtils.Output() {
+        Response resp = put(aclUrl, Constants.MEDIATYPE_ACL, new Output() {
             public void write(OutputStream out) throws Exception {
                 // TODO not implemented
                 AtomEntryWriter.writeACL(out, acl);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/DiscoveryServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/DiscoveryServiceImpl.java?rev=1423147&r1=1423146&r2=1423147&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/DiscoveryServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/DiscoveryServiceImpl.java Mon Dec 17 21:12:52 2012
@@ -29,7 +29,8 @@ import org.apache.chemistry.opencmis.cli
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomEntry;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomFeed;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomLink;
-import org.apache.chemistry.opencmis.client.bindings.spi.http.HttpUtils;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Output;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Response;
 import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
 import org.apache.chemistry.opencmis.commons.data.ObjectData;
 import org.apache.chemistry.opencmis.commons.data.ObjectList;
@@ -73,7 +74,7 @@ public class DiscoveryServiceImpl extend
         url.addParameter(Constants.PARAM_MAX_ITEMS, maxItems);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         AtomFeed feed = parse(resp.getStream(), AtomFeed.class);
 
         // handle top level
@@ -134,7 +135,7 @@ public class DiscoveryServiceImpl extend
         queryParameters.put(Constants.PARAM_SKIP_COUNT, (skipCount == null) ? null : skipCount.toString());
 
         // post the query and parse results
-        HttpUtils.Response resp = post(url, Constants.MEDIATYPE_QUERY, new HttpUtils.Output() {
+        Response resp = post(url, Constants.MEDIATYPE_QUERY, new Output() {
             public void write(OutputStream out) throws Exception {
                 AtomEntryWriter.writeQuery(out, queryParameters);
             }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/MultiFilingServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/MultiFilingServiceImpl.java?rev=1423147&r1=1423146&r2=1423147&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/MultiFilingServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/MultiFilingServiceImpl.java Mon Dec 17 21:12:52 2012
@@ -21,7 +21,7 @@ package org.apache.chemistry.opencmis.cl
 import java.io.OutputStream;
 
 import org.apache.chemistry.opencmis.client.bindings.spi.BindingSession;
-import org.apache.chemistry.opencmis.client.bindings.spi.http.HttpUtils;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Output;
 import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException;
@@ -61,7 +61,7 @@ public class MultiFilingServiceImpl exte
         final AtomEntryWriter entryWriter = new AtomEntryWriter(createIdObject(objectId));
 
         // post addObjectToFolder request
-        post(url, Constants.MEDIATYPE_ENTRY, new HttpUtils.Output() {
+        post(url, Constants.MEDIATYPE_ENTRY, new Output() {
             public void write(OutputStream out) throws Exception {
                 entryWriter.write(out);
             }
@@ -87,7 +87,7 @@ public class MultiFilingServiceImpl exte
         final AtomEntryWriter entryWriter = new AtomEntryWriter(createIdObject(objectId));
 
         // post removeObjectFromFolder request
-        post(url, Constants.MEDIATYPE_ENTRY, new HttpUtils.Output() {
+        post(url, Constants.MEDIATYPE_ENTRY, new Output() {
             public void write(OutputStream out) throws Exception {
                 entryWriter.write(out);
             }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/NavigationServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/NavigationServiceImpl.java?rev=1423147&r1=1423146&r2=1423147&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/NavigationServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/NavigationServiceImpl.java Mon Dec 17 21:12:52 2012
@@ -28,7 +28,7 @@ import org.apache.chemistry.opencmis.cli
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomEntry;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomFeed;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomLink;
-import org.apache.chemistry.opencmis.client.bindings.spi.http.HttpUtils;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Response;
 import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
 import org.apache.chemistry.opencmis.commons.data.ObjectData;
 import org.apache.chemistry.opencmis.commons.data.ObjectInFolderContainer;
@@ -50,8 +50,6 @@ import org.apache.chemistry.opencmis.com
 
 /**
  * Navigation Service AtomPub client.
- * 
- * @author <a href="mailto:fmueller@opentext.com">Florian M&uuml;ller</a>
  */
 public class NavigationServiceImpl extends AbstractAtomPubService implements NavigationService {
 
@@ -85,7 +83,7 @@ public class NavigationServiceImpl exten
         url.addParameter(Constants.PARAM_SKIP_COUNT, skipCount);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         AtomFeed feed = parse(resp.getStream(), AtomFeed.class);
 
         // handle top level
@@ -158,7 +156,7 @@ public class NavigationServiceImpl exten
         url.addParameter(Constants.PARAM_PATH_SEGMENT, includePathSegment);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         AtomFeed feed = parse(resp.getStream(), AtomFeed.class);
 
         // process tree
@@ -181,7 +179,7 @@ public class NavigationServiceImpl exten
         url.addParameter(Constants.PARAM_FILTER, filter);
 
         // read
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
 
         AtomBase base = parse(resp.getStream(), AtomBase.class);
 
@@ -240,7 +238,7 @@ public class NavigationServiceImpl exten
         url.addParameter(Constants.PARAM_PATH_SEGMENT, includePathSegment);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         AtomFeed feed = parse(resp.getStream(), AtomFeed.class);
 
         // process tree
@@ -270,7 +268,7 @@ public class NavigationServiceImpl exten
         url.addParameter(Constants.PARAM_RELATIVE_PATH_SEGMENT, includeRelativePathSegment);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
 
         AtomBase base = parse(resp.getStream(), AtomBase.class);
 
@@ -353,7 +351,7 @@ public class NavigationServiceImpl exten
         url.addParameter(Constants.PARAM_SKIP_COUNT, skipCount);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         AtomFeed feed = parse(resp.getStream(), AtomFeed.class);
 
         // handle top level

Modified: chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java?rev=1423147&r1=1423146&r2=1423147&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java Mon Dec 17 21:12:52 2012
@@ -32,7 +32,8 @@ import org.apache.chemistry.opencmis.cli
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomEntry;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomFeed;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomLink;
-import org.apache.chemistry.opencmis.client.bindings.spi.http.HttpUtils;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Output;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Response;
 import org.apache.chemistry.opencmis.commons.PropertyIds;
 import org.apache.chemistry.opencmis.commons.data.Acl;
 import org.apache.chemistry.opencmis.commons.data.AllowableActions;
@@ -122,7 +123,7 @@ public class ObjectServiceImpl extends A
         final AtomEntryWriter entryWriter = new AtomEntryWriter(object, mediaType, stream);
 
         // post the new folder object
-        HttpUtils.Response resp = post(url, Constants.MEDIATYPE_ENTRY, new HttpUtils.Output() {
+        Response resp = post(url, Constants.MEDIATYPE_ENTRY, new Output() {
             public void write(OutputStream out) throws Exception {
                 entryWriter.write(out);
             }
@@ -165,7 +166,7 @@ public class ObjectServiceImpl extends A
         final AtomEntryWriter entryWriter = new AtomEntryWriter(object);
 
         // post the new folder object
-        HttpUtils.Response resp = post(url, Constants.MEDIATYPE_ENTRY, new HttpUtils.Output() {
+        Response resp = post(url, Constants.MEDIATYPE_ENTRY, new Output() {
             public void write(OutputStream out) throws Exception {
                 entryWriter.write(out);
             }
@@ -216,7 +217,7 @@ public class ObjectServiceImpl extends A
         final AtomEntryWriter entryWriter = new AtomEntryWriter(object);
 
         // post the new folder object
-        HttpUtils.Response resp = post(url, Constants.MEDIATYPE_ENTRY, new HttpUtils.Output() {
+        Response resp = post(url, Constants.MEDIATYPE_ENTRY, new Output() {
             public void write(OutputStream out) throws Exception {
                 entryWriter.write(out);
             }
@@ -263,7 +264,7 @@ public class ObjectServiceImpl extends A
         final AtomEntryWriter entryWriter = new AtomEntryWriter(object);
 
         // post the new folder object
-        HttpUtils.Response resp = post(url, Constants.MEDIATYPE_ENTRY, new HttpUtils.Output() {
+        Response resp = post(url, Constants.MEDIATYPE_ENTRY, new Output() {
             public void write(OutputStream out) throws Exception {
                 entryWriter.write(out);
             }
@@ -310,7 +311,7 @@ public class ObjectServiceImpl extends A
         final AtomEntryWriter entryWriter = new AtomEntryWriter(object);
 
         // post the new folder object
-        HttpUtils.Response resp = post(url, Constants.MEDIATYPE_ENTRY, new HttpUtils.Output() {
+        Response resp = post(url, Constants.MEDIATYPE_ENTRY, new Output() {
             public void write(OutputStream out) throws Exception {
                 entryWriter.write(out);
             }
@@ -354,7 +355,7 @@ public class ObjectServiceImpl extends A
         final AtomEntryWriter entryWriter = new AtomEntryWriter(object);
 
         // update
-        HttpUtils.Response resp = put(url, Constants.MEDIATYPE_ENTRY, new HttpUtils.Output() {
+        Response resp = put(url, Constants.MEDIATYPE_ENTRY, new Output() {
             public void write(OutputStream out) throws Exception {
                 entryWriter.write(out);
             }
@@ -452,7 +453,7 @@ public class ObjectServiceImpl extends A
         url.addParameter(Constants.PARAM_CONTINUE_ON_FAILURE, continueOnFailure);
 
         // make the call
-        HttpUtils.Response resp = HttpUtils.invokeDELETE(url, getSession());
+        Response resp = getHttpInvoker().invokeDELETE(url, getSession());
 
         // check response code
         if (resp.getResponseCode() == 200 || resp.getResponseCode() == 202 || resp.getResponseCode() == 204) {
@@ -511,7 +512,7 @@ public class ObjectServiceImpl extends A
         UrlBuilder url = new UrlBuilder(link);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         AtomAllowableActions allowableActions = parse(resp.getStream(), AtomAllowableActions.class);
 
         return allowableActions.getAllowableActions();
@@ -544,7 +545,7 @@ public class ObjectServiceImpl extends A
         url.addParameter(Constants.PARAM_STREAM_ID, streamId);
 
         // get the content
-        HttpUtils.Response resp = HttpUtils.invokeGET(url, getSession(), offset, length);
+        Response resp = getHttpInvoker().invokeGET(url, getSession(), offset, length);
 
         // check response code
         if ((resp.getResponseCode() != 200) && (resp.getResponseCode() != 206)) {
@@ -626,7 +627,7 @@ public class ObjectServiceImpl extends A
         final AtomEntryWriter entryWriter = new AtomEntryWriter(createIdObject(objectId.getValue()));
 
         // post move request
-        HttpUtils.Response resp = post(url, Constants.MEDIATYPE_ENTRY, new HttpUtils.Output() {
+        Response resp = post(url, Constants.MEDIATYPE_ENTRY, new Output() {
             public void write(OutputStream out) throws Exception {
                 entryWriter.write(out);
             }
@@ -676,7 +677,7 @@ public class ObjectServiceImpl extends A
         }
 
         // send content
-        HttpUtils.Response resp = put(url, contentStream.getMimeType(), headers, new HttpUtils.Output() {
+        Response resp = put(url, contentStream.getMimeType(), headers, new Output() {
             public void write(OutputStream out) throws Exception {
                 int b;
                 byte[] buffer = new byte[4096];

Modified: chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/PolicyServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/PolicyServiceImpl.java?rev=1423147&r1=1423146&r2=1423147&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/PolicyServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/PolicyServiceImpl.java Mon Dec 17 21:12:52 2012
@@ -27,7 +27,8 @@ import org.apache.chemistry.opencmis.cli
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomEntry;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomFeed;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomLink;
-import org.apache.chemistry.opencmis.client.bindings.spi.http.HttpUtils;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Output;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Response;
 import org.apache.chemistry.opencmis.commons.PropertyIds;
 import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
 import org.apache.chemistry.opencmis.commons.data.ObjectData;
@@ -64,7 +65,7 @@ public class PolicyServiceImpl extends A
         final AtomEntryWriter entryWriter = new AtomEntryWriter(createIdObject(objectId));
 
         // post applyPolicy request
-        post(url, Constants.MEDIATYPE_ENTRY, new HttpUtils.Output() {
+        post(url, Constants.MEDIATYPE_ENTRY, new Output() {
             public void write(OutputStream out) throws Exception {
                 entryWriter.write(out);
             }
@@ -86,7 +87,7 @@ public class PolicyServiceImpl extends A
         url.addParameter(Constants.PARAM_FILTER, filter);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         AtomFeed feed = parse(resp.getStream(), AtomFeed.class);
 
         // get the policies
@@ -127,7 +128,7 @@ public class PolicyServiceImpl extends A
         url.addParameter(Constants.PARAM_FILTER, PropertyIds.OBJECT_ID);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         AtomFeed feed = parse(resp.getStream(), AtomFeed.class);
 
         // find the policy

Modified: chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/RelationshipServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/RelationshipServiceImpl.java?rev=1423147&r1=1423146&r2=1423147&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/RelationshipServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/RelationshipServiceImpl.java Mon Dec 17 21:12:52 2012
@@ -26,7 +26,7 @@ import org.apache.chemistry.opencmis.cli
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomEntry;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomFeed;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomLink;
-import org.apache.chemistry.opencmis.client.bindings.spi.http.HttpUtils;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Response;
 import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
 import org.apache.chemistry.opencmis.commons.data.ObjectData;
 import org.apache.chemistry.opencmis.commons.data.ObjectList;
@@ -70,7 +70,7 @@ public class RelationshipServiceImpl ext
         url.addParameter(Constants.PARAM_SKIP_COUNT, skipCount);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         AtomFeed feed = parse(resp.getStream(), AtomFeed.class);
 
         // handle top level

Modified: chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/RepositoryServiceImpl.java?rev=1423147&r1=1423146&r2=1423147&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/RepositoryServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/RepositoryServiceImpl.java Mon Dec 17 21:12:52 2012
@@ -27,7 +27,7 @@ import org.apache.chemistry.opencmis.cli
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomEntry;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomFeed;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomLink;
-import org.apache.chemistry.opencmis.client.bindings.spi.http.HttpUtils;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Response;
 import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
 import org.apache.chemistry.opencmis.commons.data.RepositoryInfo;
 import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
@@ -101,7 +101,7 @@ public class RepositoryServiceImpl exten
         url.addParameter(Constants.PARAM_SKIP_COUNT, skipCount);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         AtomFeed feed = parse(resp.getStream(), AtomFeed.class);
 
         // handle top level
@@ -167,7 +167,7 @@ public class RepositoryServiceImpl exten
         url.addParameter(Constants.PARAM_PROPERTY_DEFINITIONS, includePropertyDefinitions);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         AtomFeed feed = parse(resp.getStream(), AtomFeed.class);
 
         // process tree

Modified: chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/VersioningServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/VersioningServiceImpl.java?rev=1423147&r1=1423146&r2=1423147&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/VersioningServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/VersioningServiceImpl.java Mon Dec 17 21:12:52 2012
@@ -28,7 +28,8 @@ import org.apache.chemistry.opencmis.cli
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomEntry;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomFeed;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomLink;
-import org.apache.chemistry.opencmis.client.bindings.spi.http.HttpUtils;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Output;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Response;
 import org.apache.chemistry.opencmis.commons.data.Acl;
 import org.apache.chemistry.opencmis.commons.data.ContentStream;
 import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
@@ -77,7 +78,7 @@ public class VersioningServiceImpl exten
         final AtomEntryWriter entryWriter = new AtomEntryWriter(createIdObject(objectId.getValue()));
 
         // post move request
-        HttpUtils.Response resp = post(url, Constants.MEDIATYPE_ENTRY, new HttpUtils.Output() {
+        Response resp = post(url, Constants.MEDIATYPE_ENTRY, new Output() {
             public void write(OutputStream out) throws Exception {
                 entryWriter.write(out);
             }
@@ -174,7 +175,7 @@ public class VersioningServiceImpl exten
         final AtomEntryWriter entryWriter = new AtomEntryWriter(object, mediaType, stream);
 
         // update
-        HttpUtils.Response resp = put(url, Constants.MEDIATYPE_ENTRY, new HttpUtils.Output() {
+        Response resp = put(url, Constants.MEDIATYPE_ENTRY, new Output() {
             public void write(OutputStream out) throws Exception {
                 entryWriter.write(out);
             }
@@ -240,7 +241,7 @@ public class VersioningServiceImpl exten
         url.addParameter(Constants.PARAM_ALLOWABLE_ACTIONS, includeAllowableActions);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         AtomFeed feed = parse(resp.getStream(), AtomFeed.class);
 
         // get the versions

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/CmisBindingFactory.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/CmisBindingFactory.java?rev=1423147&r1=1423146&r2=1423147&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/CmisBindingFactory.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/CmisBindingFactory.java Mon Dec 17 21:12:52 2012
@@ -40,6 +40,8 @@ public class CmisBindingFactory {
     /** Default CMIS local binding SPI implementation */
     public static final String BINDING_SPI_LOCAL = "org.apache.chemistry.opencmis.client.bindings.spi.local.CmisLocalSpi";
 
+    /** Default HTTP invoker class */
+    public static final String DEFAULT_HTTP_INVOKER = "org.apache.chemistry.opencmis.client.bindings.spi.http.DefaultHttpInvoker";
     /** Standard authentication provider class */
     public static final String STANDARD_AUTHENTICATION_PROVIDER = "org.apache.chemistry.opencmis.client.bindings.spi.StandardAuthenticationProvider";
     /** NTLM authentication provider class */
@@ -116,6 +118,9 @@ public class CmisBindingFactory {
         checkSessionParameters(sessionParameters, false);
 
         sessionParameters.put(SessionParameter.BINDING_SPI_CLASS, BINDING_SPI_ATOMPUB);
+        if (!sessionParameters.containsKey(SessionParameter.HTTP_INVOKER_CLASS)) {
+            sessionParameters.put(SessionParameter.HTTP_INVOKER_CLASS, DEFAULT_HTTP_INVOKER);
+        }
         if (authenticationProvider == null) {
             if (!sessionParameters.containsKey(SessionParameter.AUTHENTICATION_PROVIDER_CLASS)) {
                 sessionParameters.put(SessionParameter.AUTHENTICATION_PROVIDER_CLASS, STANDARD_AUTHENTICATION_PROVIDER);
@@ -190,6 +195,9 @@ public class CmisBindingFactory {
         checkSessionParameters(sessionParameters, false);
 
         sessionParameters.put(SessionParameter.BINDING_SPI_CLASS, BINDING_SPI_BROWSER);
+        if (!sessionParameters.containsKey(SessionParameter.HTTP_INVOKER_CLASS)) {
+            sessionParameters.put(SessionParameter.HTTP_INVOKER_CLASS, DEFAULT_HTTP_INVOKER);
+        }
         if (authenticationProvider == null) {
             if (!sessionParameters.containsKey(SessionParameter.AUTHENTICATION_PROVIDER_CLASS)) {
                 sessionParameters.put(SessionParameter.AUTHENTICATION_PROVIDER_CLASS, STANDARD_AUTHENTICATION_PROVIDER);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/CmisBindingsHelper.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/CmisBindingsHelper.java?rev=1423147&r1=1423146&r2=1423147&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/CmisBindingsHelper.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/CmisBindingsHelper.java Mon Dec 17 21:12:52 2012
@@ -22,6 +22,7 @@ import java.lang.reflect.Constructor;
 
 import org.apache.chemistry.opencmis.client.bindings.spi.BindingSession;
 import org.apache.chemistry.opencmis.client.bindings.spi.CmisSpi;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.HttpInvoker;
 import org.apache.chemistry.opencmis.commons.SessionParameter;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisBaseException;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
@@ -36,6 +37,7 @@ public final class CmisBindingsHelper {
     public static final String REPOSITORY_INFO_CACHE = "org.apache.chemistry.opencmis.binding.repositoryInfoCache";
     public static final String TYPE_DEFINTION_CACHE = "org.apache.chemistry.opencmis.binding.typeDefintionCache";
     public static final String SPI_OBJECT = "org.apache.chemistry.opencmis.binding.spi.object";
+    public static final String HTTP_INVOKER_OBJECT = "org.apache.chemistry.opencmis.binding.httpinvoker.object";
     public static final String AUTHENTICATION_PROVIDER_OBJECT = "org.apache.chemistry.opencmis.binding.auth.object";
     public static final String ACCEPT_LANGUAGE = "org.apache.chemistry.opencmis.binding.acceptLanguage";
 
@@ -91,6 +93,43 @@ public final class CmisBindingsHelper {
     }
 
     /**
+     * Gets the HTTP Invoker object from the session.
+     */
+    public static HttpInvoker getHttpInvoker(BindingSession session) {
+        HttpInvoker invoker = (HttpInvoker) session.get(HTTP_INVOKER_OBJECT);
+
+        if (invoker != null) {
+            return invoker;
+        }
+
+        session.writeLock();
+        try {
+            // try again
+            invoker = (HttpInvoker) session.get(HTTP_INVOKER_OBJECT);
+            if (invoker != null) {
+                return invoker;
+            }
+
+            // ok, we have to create it...
+            try {
+                String invokerName = (String) session.get(SessionParameter.HTTP_INVOKER_CLASS);
+                invoker = (HttpInvoker) Class.forName(invokerName).newInstance();
+            } catch (CmisBaseException e) {
+                throw e;
+            } catch (Exception e) {
+                throw new CmisRuntimeException("HTTP invoker cannot be initialized: " + e.getMessage(), e);
+            }
+
+            // we have an Invoker object -> put it into the session
+            session.put(HTTP_INVOKER_OBJECT, invoker, true);
+        } finally {
+            session.writeUnlock();
+        }
+
+        return invoker;
+    }
+
+    /**
      * Returns the authentication provider from the session or <code>null</code>
      * if no authentication provider is set.
      */

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java?rev=1423147&r1=1423146&r2=1423147&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java Mon Dec 17 21:12:52 2012
@@ -30,6 +30,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.chemistry.opencmis.client.bindings.impl.CmisBindingsHelper;
 import org.apache.chemistry.opencmis.client.bindings.spi.BindingSession;
 import org.apache.chemistry.opencmis.client.bindings.spi.LinkAccess;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomAcl;
@@ -39,7 +40,9 @@ import org.apache.chemistry.opencmis.cli
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomLink;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.RepositoryWorkspace;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.ServiceDoc;
-import org.apache.chemistry.opencmis.client.bindings.spi.http.HttpUtils;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.HttpInvoker;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Output;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Response;
 import org.apache.chemistry.opencmis.commons.PropertyIds;
 import org.apache.chemistry.opencmis.commons.SessionParameter;
 import org.apache.chemistry.opencmis.commons.data.Ace;
@@ -113,6 +116,13 @@ public abstract class AbstractAtomPubSer
     }
 
     /**
+     * Gets the HTTP Invoker object.
+     */
+    protected HttpInvoker getHttpInvoker() {
+        return CmisBindingsHelper.getHttpInvoker(session);
+    }
+
+    /**
      * Returns the service document URL of this session.
      */
     protected String getServiceDocURL() {
@@ -545,9 +555,9 @@ public abstract class AbstractAtomPubSer
      * Performs a GET on an URL, checks the response code and returns the
      * result.
      */
-    protected HttpUtils.Response read(UrlBuilder url) {
+    protected Response read(UrlBuilder url) {
         // make the call
-        HttpUtils.Response resp = HttpUtils.invokeGET(url, session);
+        Response resp = getHttpInvoker().invokeGET(url, session);
 
         // check response code
         if (resp.getResponseCode() != 200) {
@@ -561,9 +571,9 @@ public abstract class AbstractAtomPubSer
      * Performs a POST on an URL, checks the response code and returns the
      * result.
      */
-    protected HttpUtils.Response post(UrlBuilder url, String contentType, HttpUtils.Output writer) {
+    protected Response post(UrlBuilder url, String contentType, Output writer) {
         // make the call
-        HttpUtils.Response resp = HttpUtils.invokePOST(url, contentType, writer, session);
+        Response resp = getHttpInvoker().invokePOST(url, contentType, writer, session);
 
         // check response code
         if (resp.getResponseCode() != 201) {
@@ -577,7 +587,7 @@ public abstract class AbstractAtomPubSer
      * Performs a PUT on an URL, checks the response code and returns the
      * result.
      */
-    protected HttpUtils.Response put(UrlBuilder url, String contentType, HttpUtils.Output writer) {
+    protected Response put(UrlBuilder url, String contentType, Output writer) {
         return put(url, contentType, null, writer);
     }
 
@@ -585,10 +595,9 @@ public abstract class AbstractAtomPubSer
      * Performs a PUT on an URL, checks the response code and returns the
      * result.
      */
-    protected HttpUtils.Response put(UrlBuilder url, String contentType, Map<String, String> headers,
-            HttpUtils.Output writer) {
+    protected Response put(UrlBuilder url, String contentType, Map<String, String> headers, Output writer) {
         // make the call
-        HttpUtils.Response resp = HttpUtils.invokePUT(url, contentType, headers, writer, session);
+        Response resp = getHttpInvoker().invokePUT(url, contentType, headers, writer, session);
 
         // check response code
         if ((resp.getResponseCode() < 200) || (resp.getResponseCode() > 299)) {
@@ -604,7 +613,7 @@ public abstract class AbstractAtomPubSer
      */
     protected void delete(UrlBuilder url) {
         // make the call
-        HttpUtils.Response resp = HttpUtils.invokeDELETE(url, session);
+        Response resp = getHttpInvoker().invokeDELETE(url, session);
 
         // check response code
         if (resp.getResponseCode() != 204) {
@@ -715,7 +724,7 @@ public abstract class AbstractAtomPubSer
         url.addParameter(Constants.PARAM_REPOSITORY_ID, repositoryId);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         ServiceDoc serviceDoc = parse(resp.getStream(), ServiceDoc.class);
 
         // walk through the workspaces
@@ -775,7 +784,7 @@ public abstract class AbstractAtomPubSer
         }
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         AtomEntry entry = parse(resp.getStream(), AtomEntry.class);
 
         // we expect a CMIS entry
@@ -818,7 +827,7 @@ public abstract class AbstractAtomPubSer
         }
 
         // read and parse
-        HttpUtils.Response resp = read(new UrlBuilder(link));
+        Response resp = read(new UrlBuilder(link));
         AtomEntry entry = parse(resp.getStream(), AtomEntry.class);
 
         // we expect a CMIS entry
@@ -864,7 +873,7 @@ public abstract class AbstractAtomPubSer
         url.addParameter(Constants.PARAM_ONLY_BASIC_PERMISSIONS, onlyBasicPermissions);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         AtomAcl acl = parse(resp.getStream(), AtomAcl.class);
 
         return convert(acl.getACL(), null);
@@ -889,7 +898,7 @@ public abstract class AbstractAtomPubSer
         final CmisAccessControlListType aclJaxb = convert(acl);
 
         // update
-        HttpUtils.Response resp = put(aclUrl, Constants.MEDIATYPE_ACL, new HttpUtils.Output() {
+        Response resp = put(aclUrl, Constants.MEDIATYPE_ACL, new Output() {
             public void write(OutputStream out) throws Exception {
                 JaxBHelper.marshal(JaxBHelper.CMIS_OBJECT_FACTORY.createAcl(aclJaxb), out, false);
             }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AtomEntryWriter.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AtomEntryWriter.java?rev=1423147&r1=1423146&r2=1423147&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AtomEntryWriter.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AtomEntryWriter.java Mon Dec 17 21:12:52 2012
@@ -197,7 +197,6 @@ public class AtomEntryWriter {
     }
 
     private void writeContent(XMLStreamWriter writer) throws Exception {
-        @SuppressWarnings("resource")
         Base64.InputStream b64stream = new Base64.InputStream(stream, Base64.ENCODE);
 
         byte[] buffer = new byte[BUFFER_SIZE * 3 / 4];

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/DiscoveryServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/DiscoveryServiceImpl.java?rev=1423147&r1=1423146&r2=1423147&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/DiscoveryServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/DiscoveryServiceImpl.java Mon Dec 17 21:12:52 2012
@@ -29,7 +29,8 @@ import org.apache.chemistry.opencmis.cli
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomEntry;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomFeed;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomLink;
-import org.apache.chemistry.opencmis.client.bindings.spi.http.HttpUtils;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Output;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Response;
 import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
 import org.apache.chemistry.opencmis.commons.data.ObjectData;
 import org.apache.chemistry.opencmis.commons.data.ObjectList;
@@ -77,7 +78,7 @@ public class DiscoveryServiceImpl extend
         url.addParameter(Constants.PARAM_MAX_ITEMS, maxItems);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         AtomFeed feed = parse(resp.getStream(), AtomFeed.class);
 
         // handle top level
@@ -139,7 +140,7 @@ public class DiscoveryServiceImpl extend
         query.setSkipCount(skipCount);
 
         // post the query and parse results
-        HttpUtils.Response resp = post(url, Constants.MEDIATYPE_QUERY, new HttpUtils.Output() {
+        Response resp = post(url, Constants.MEDIATYPE_QUERY, new Output() {
             public void write(OutputStream out) throws Exception {
                 JaxBHelper.marshal(JaxBHelper.CMIS_OBJECT_FACTORY.createQuery(query), out, false);
             }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/MultiFilingServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/MultiFilingServiceImpl.java?rev=1423147&r1=1423146&r2=1423147&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/MultiFilingServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/MultiFilingServiceImpl.java Mon Dec 17 21:12:52 2012
@@ -21,7 +21,7 @@ package org.apache.chemistry.opencmis.cl
 import java.io.OutputStream;
 
 import org.apache.chemistry.opencmis.client.bindings.spi.BindingSession;
-import org.apache.chemistry.opencmis.client.bindings.spi.http.HttpUtils;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Output;
 import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
 import org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException;
@@ -61,7 +61,7 @@ public class MultiFilingServiceImpl exte
         final AtomEntryWriter entryWriter = new AtomEntryWriter(createIdObject(objectId));
 
         // post addObjectToFolder request
-        post(url, Constants.MEDIATYPE_ENTRY, new HttpUtils.Output() {
+        post(url, Constants.MEDIATYPE_ENTRY, new Output() {
             public void write(OutputStream out) throws Exception {
                 entryWriter.write(out);
             }
@@ -87,7 +87,7 @@ public class MultiFilingServiceImpl exte
         final AtomEntryWriter entryWriter = new AtomEntryWriter(createIdObject(objectId));
 
         // post removeObjectFromFolder request
-        post(url, Constants.MEDIATYPE_ENTRY, new HttpUtils.Output() {
+        post(url, Constants.MEDIATYPE_ENTRY, new Output() {
             public void write(OutputStream out) throws Exception {
                 entryWriter.write(out);
             }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/NavigationServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/NavigationServiceImpl.java?rev=1423147&r1=1423146&r2=1423147&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/NavigationServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/NavigationServiceImpl.java Mon Dec 17 21:12:52 2012
@@ -30,7 +30,7 @@ import org.apache.chemistry.opencmis.cli
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomEntry;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomFeed;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomLink;
-import org.apache.chemistry.opencmis.client.bindings.spi.http.HttpUtils;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Response;
 import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
 import org.apache.chemistry.opencmis.commons.data.ObjectData;
 import org.apache.chemistry.opencmis.commons.data.ObjectInFolderContainer;
@@ -88,7 +88,7 @@ public class NavigationServiceImpl exten
         url.addParameter(Constants.PARAM_SKIP_COUNT, skipCount);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         AtomFeed feed = parse(resp.getStream(), AtomFeed.class);
 
         // handle top level
@@ -161,7 +161,7 @@ public class NavigationServiceImpl exten
         url.addParameter(Constants.PARAM_PATH_SEGMENT, includePathSegment);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         AtomFeed feed = parse(resp.getStream(), AtomFeed.class);
 
         // process tree
@@ -184,7 +184,7 @@ public class NavigationServiceImpl exten
         url.addParameter(Constants.PARAM_FILTER, filter);
 
         // read
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
 
         AtomBase base = parse(resp.getStream(), AtomBase.class);
 
@@ -243,7 +243,7 @@ public class NavigationServiceImpl exten
         url.addParameter(Constants.PARAM_PATH_SEGMENT, includePathSegment);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         AtomFeed feed = parse(resp.getStream(), AtomFeed.class);
 
         // process tree
@@ -273,7 +273,7 @@ public class NavigationServiceImpl exten
         url.addParameter(Constants.PARAM_RELATIVE_PATH_SEGMENT, includeRelativePathSegment);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
 
         AtomBase base = parse(resp.getStream(), AtomBase.class);
 
@@ -356,7 +356,7 @@ public class NavigationServiceImpl exten
         url.addParameter(Constants.PARAM_SKIP_COUNT, skipCount);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         AtomFeed feed = parse(resp.getStream(), AtomFeed.class);
 
         // handle top level

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java?rev=1423147&r1=1423146&r2=1423147&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java Mon Dec 17 21:12:52 2012
@@ -35,7 +35,8 @@ import org.apache.chemistry.opencmis.cli
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomEntry;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomFeed;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomLink;
-import org.apache.chemistry.opencmis.client.bindings.spi.http.HttpUtils;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Output;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Response;
 import org.apache.chemistry.opencmis.commons.PropertyIds;
 import org.apache.chemistry.opencmis.commons.data.Acl;
 import org.apache.chemistry.opencmis.commons.data.AllowableActions;
@@ -117,7 +118,7 @@ public class ObjectServiceImpl extends A
         final AtomEntryWriter entryWriter = new AtomEntryWriter(object, contentStream);
 
         // post the new folder object
-        HttpUtils.Response resp = post(url, Constants.MEDIATYPE_ENTRY, new HttpUtils.Output() {
+        Response resp = post(url, Constants.MEDIATYPE_ENTRY, new Output() {
             public void write(OutputStream out) throws Exception {
                 entryWriter.write(out);
             }
@@ -159,7 +160,7 @@ public class ObjectServiceImpl extends A
         final AtomEntryWriter entryWriter = new AtomEntryWriter(object);
 
         // post the new folder object
-        HttpUtils.Response resp = post(url, Constants.MEDIATYPE_ENTRY, new HttpUtils.Output() {
+        Response resp = post(url, Constants.MEDIATYPE_ENTRY, new Output() {
             public void write(OutputStream out) throws Exception {
                 entryWriter.write(out);
             }
@@ -209,7 +210,7 @@ public class ObjectServiceImpl extends A
         final AtomEntryWriter entryWriter = new AtomEntryWriter(object);
 
         // post the new folder object
-        HttpUtils.Response resp = post(url, Constants.MEDIATYPE_ENTRY, new HttpUtils.Output() {
+        Response resp = post(url, Constants.MEDIATYPE_ENTRY, new Output() {
             public void write(OutputStream out) throws Exception {
                 entryWriter.write(out);
             }
@@ -255,7 +256,7 @@ public class ObjectServiceImpl extends A
         final AtomEntryWriter entryWriter = new AtomEntryWriter(object);
 
         // post the new folder object
-        HttpUtils.Response resp = post(url, Constants.MEDIATYPE_ENTRY, new HttpUtils.Output() {
+        Response resp = post(url, Constants.MEDIATYPE_ENTRY, new Output() {
             public void write(OutputStream out) throws Exception {
                 entryWriter.write(out);
             }
@@ -302,7 +303,7 @@ public class ObjectServiceImpl extends A
         final AtomEntryWriter entryWriter = new AtomEntryWriter(object);
 
         // post the new folder object
-        HttpUtils.Response resp = post(url, Constants.MEDIATYPE_ENTRY, new HttpUtils.Output() {
+        Response resp = post(url, Constants.MEDIATYPE_ENTRY, new Output() {
             public void write(OutputStream out) throws Exception {
                 entryWriter.write(out);
             }
@@ -343,7 +344,7 @@ public class ObjectServiceImpl extends A
         final AtomEntryWriter entryWriter = new AtomEntryWriter(object);
 
         // update
-        HttpUtils.Response resp = put(url, Constants.MEDIATYPE_ENTRY, new HttpUtils.Output() {
+        Response resp = put(url, Constants.MEDIATYPE_ENTRY, new Output() {
             public void write(OutputStream out) throws Exception {
                 entryWriter.write(out);
             }
@@ -455,7 +456,7 @@ public class ObjectServiceImpl extends A
         url.addParameter(Constants.PARAM_CONTINUE_ON_FAILURE, continueOnFailure);
 
         // make the call
-        HttpUtils.Response resp = HttpUtils.invokeDELETE(url, getSession());
+        Response resp = getHttpInvoker().invokeDELETE(url, getSession());
 
         // check response code
         if (resp.getResponseCode() == 200 || resp.getResponseCode() == 202 || resp.getResponseCode() == 204) {
@@ -514,7 +515,7 @@ public class ObjectServiceImpl extends A
         UrlBuilder url = new UrlBuilder(link);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         AtomAllowableActions allowableActions = parse(resp.getStream(), AtomAllowableActions.class);
 
         return convert(allowableActions.getAllowableActions());
@@ -547,7 +548,7 @@ public class ObjectServiceImpl extends A
         url.addParameter(Constants.PARAM_STREAM_ID, streamId);
 
         // get the content
-        HttpUtils.Response resp = HttpUtils.invokeGET(url, getSession(), offset, length);
+        Response resp = getHttpInvoker().invokeGET(url, getSession(), offset, length);
 
         // check response code
         if ((resp.getResponseCode() != 200) && (resp.getResponseCode() != 206)) {
@@ -624,7 +625,7 @@ public class ObjectServiceImpl extends A
         final AtomEntryWriter entryWriter = new AtomEntryWriter(createIdObject(objectId.getValue()));
 
         // post move request
-        HttpUtils.Response resp = post(url, Constants.MEDIATYPE_ENTRY, new HttpUtils.Output() {
+        Response resp = post(url, Constants.MEDIATYPE_ENTRY, new Output() {
             public void write(OutputStream out) throws Exception {
                 entryWriter.write(out);
             }
@@ -674,7 +675,7 @@ public class ObjectServiceImpl extends A
         }
 
         // send content
-        HttpUtils.Response resp = put(url, contentStream.getMimeType(), headers, new HttpUtils.Output() {
+        Response resp = put(url, contentStream.getMimeType(), headers, new Output() {
             public void write(OutputStream out) throws Exception {
                 int b;
                 byte[] buffer = new byte[4096];

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/PolicyServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/PolicyServiceImpl.java?rev=1423147&r1=1423146&r2=1423147&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/PolicyServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/PolicyServiceImpl.java Mon Dec 17 21:12:52 2012
@@ -29,7 +29,8 @@ import org.apache.chemistry.opencmis.cli
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomEntry;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomFeed;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomLink;
-import org.apache.chemistry.opencmis.client.bindings.spi.http.HttpUtils;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Output;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Response;
 import org.apache.chemistry.opencmis.commons.PropertyIds;
 import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
 import org.apache.chemistry.opencmis.commons.data.ObjectData;
@@ -67,7 +68,7 @@ public class PolicyServiceImpl extends A
         final AtomEntryWriter entryWriter = new AtomEntryWriter(createIdObject(objectId));
 
         // post applyPolicy request
-        post(url, Constants.MEDIATYPE_ENTRY, new HttpUtils.Output() {
+        post(url, Constants.MEDIATYPE_ENTRY, new Output() {
             public void write(OutputStream out) throws Exception {
                 entryWriter.write(out);
             }
@@ -89,7 +90,7 @@ public class PolicyServiceImpl extends A
         url.addParameter(Constants.PARAM_FILTER, filter);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         AtomFeed feed = parse(resp.getStream(), AtomFeed.class);
 
         // get the policies
@@ -130,7 +131,7 @@ public class PolicyServiceImpl extends A
         url.addParameter(Constants.PARAM_FILTER, PropertyIds.OBJECT_ID);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         AtomFeed feed = parse(resp.getStream(), AtomFeed.class);
 
         // find the policy

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/RelationshipServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/RelationshipServiceImpl.java?rev=1423147&r1=1423146&r2=1423147&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/RelationshipServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/RelationshipServiceImpl.java Mon Dec 17 21:12:52 2012
@@ -28,7 +28,7 @@ import org.apache.chemistry.opencmis.cli
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomEntry;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomFeed;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomLink;
-import org.apache.chemistry.opencmis.client.bindings.spi.http.HttpUtils;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Response;
 import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
 import org.apache.chemistry.opencmis.commons.data.ObjectData;
 import org.apache.chemistry.opencmis.commons.data.ObjectList;
@@ -73,7 +73,7 @@ public class RelationshipServiceImpl ext
         url.addParameter(Constants.PARAM_SKIP_COUNT, skipCount);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         AtomFeed feed = parse(resp.getStream(), AtomFeed.class);
 
         // handle top level

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/RepositoryServiceImpl.java?rev=1423147&r1=1423146&r2=1423147&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/RepositoryServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/RepositoryServiceImpl.java Mon Dec 17 21:12:52 2012
@@ -29,7 +29,7 @@ import org.apache.chemistry.opencmis.cli
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomEntry;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomFeed;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomLink;
-import org.apache.chemistry.opencmis.client.bindings.spi.http.HttpUtils;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Response;
 import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
 import org.apache.chemistry.opencmis.commons.data.RepositoryInfo;
 import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
@@ -111,7 +111,7 @@ public class RepositoryServiceImpl exten
         url.addParameter(Constants.PARAM_SKIP_COUNT, skipCount);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         AtomFeed feed = parse(resp.getStream(), AtomFeed.class);
 
         // handle top level
@@ -176,7 +176,7 @@ public class RepositoryServiceImpl exten
         url.addParameter(Constants.PARAM_PROPERTY_DEFINITIONS, includePropertyDefinitions);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         AtomFeed feed = parse(resp.getStream(), AtomFeed.class);
 
         // process tree

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/VersioningServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/VersioningServiceImpl.java?rev=1423147&r1=1423146&r2=1423147&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/VersioningServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/VersioningServiceImpl.java Mon Dec 17 21:12:52 2012
@@ -30,7 +30,8 @@ import org.apache.chemistry.opencmis.cli
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomEntry;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomFeed;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomLink;
-import org.apache.chemistry.opencmis.client.bindings.spi.http.HttpUtils;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Output;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Response;
 import org.apache.chemistry.opencmis.commons.data.Acl;
 import org.apache.chemistry.opencmis.commons.data.ContentStream;
 import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
@@ -79,7 +80,7 @@ public class VersioningServiceImpl exten
         final AtomEntryWriter entryWriter = new AtomEntryWriter(createIdObject(objectId.getValue()));
 
         // post move request
-        HttpUtils.Response resp = post(url, Constants.MEDIATYPE_ENTRY, new HttpUtils.Output() {
+        Response resp = post(url, Constants.MEDIATYPE_ENTRY, new Output() {
             public void write(OutputStream out) throws Exception {
                 entryWriter.write(out);
             }
@@ -167,7 +168,7 @@ public class VersioningServiceImpl exten
         final AtomEntryWriter entryWriter = new AtomEntryWriter(object, contentStream);
 
         // update
-        HttpUtils.Response resp = put(url, Constants.MEDIATYPE_ENTRY, new HttpUtils.Output() {
+        Response resp = put(url, Constants.MEDIATYPE_ENTRY, new Output() {
             public void write(OutputStream out) throws Exception {
                 entryWriter.write(out);
             }
@@ -231,7 +232,7 @@ public class VersioningServiceImpl exten
         url.addParameter(Constants.PARAM_ALLOWABLE_ACTIONS, includeAllowableActions);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         AtomFeed feed = parse(resp.getStream(), AtomFeed.class);
 
         // get the versions

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/AbstractBrowserBindingService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/AbstractBrowserBindingService.java?rev=1423147&r1=1423146&r2=1423147&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/AbstractBrowserBindingService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/AbstractBrowserBindingService.java Mon Dec 17 21:12:52 2012
@@ -25,9 +25,12 @@ import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.chemistry.opencmis.client.bindings.impl.CmisBindingsHelper;
 import org.apache.chemistry.opencmis.client.bindings.spi.BindingSession;
 import org.apache.chemistry.opencmis.client.bindings.spi.LinkAccess;
-import org.apache.chemistry.opencmis.client.bindings.spi.http.HttpUtils;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.HttpInvoker;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Output;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Response;
 import org.apache.chemistry.opencmis.commons.SessionParameter;
 import org.apache.chemistry.opencmis.commons.data.RepositoryInfo;
 import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
@@ -93,6 +96,13 @@ public abstract class AbstractBrowserBin
     }
 
     /**
+     * Gets the HTTP Invoker object.
+     */
+    protected HttpInvoker getHttpInvoker() {
+        return CmisBindingsHelper.getHttpInvoker(session);
+    }
+
+    /**
      * Returns the service URL of this session.
      */
     protected String getServiceUrl() {
@@ -326,9 +336,9 @@ public abstract class AbstractBrowserBin
      * Performs a GET on an URL, checks the response code and returns the
      * result.
      */
-    protected HttpUtils.Response read(UrlBuilder url) {
+    protected Response read(UrlBuilder url) {
         // make the call
-        HttpUtils.Response resp = HttpUtils.invokeGET(url, session);
+        Response resp = getHttpInvoker().invokeGET(url, session);
 
         // check response code
         if (resp.getResponseCode() != 200) {
@@ -342,9 +352,9 @@ public abstract class AbstractBrowserBin
      * Performs a POST on an URL, checks the response code and returns the
      * result.
      */
-    protected HttpUtils.Response post(UrlBuilder url, String contentType, HttpUtils.Output writer) {
+    protected Response post(UrlBuilder url, String contentType, Output writer) {
         // make the call
-        HttpUtils.Response resp = HttpUtils.invokePOST(url, contentType, writer, session);
+        Response resp = getHttpInvoker().invokePOST(url, contentType, writer, session);
 
         // check response code
         if (resp.getResponseCode() != 200 && resp.getResponseCode() != 201) {
@@ -358,8 +368,8 @@ public abstract class AbstractBrowserBin
      * Performs a POST on an URL, checks the response code and returns the
      * result.
      */
-    protected void postAndConsume(UrlBuilder url, String contentType, HttpUtils.Output writer) {
-        HttpUtils.Response resp = post(url, contentType, writer);
+    protected void postAndConsume(UrlBuilder url, String contentType, Output writer) {
+        Response resp = post(url, contentType, writer);
 
         InputStream stream = resp.getStream();
         try {
@@ -413,7 +423,7 @@ public abstract class AbstractBrowserBin
         }
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         Map<String, Object> json = parseObject(resp.getStream(), resp.getCharset());
 
         List<RepositoryInfo> repInfos = new ArrayList<RepositoryInfo>();
@@ -453,7 +463,7 @@ public abstract class AbstractBrowserBin
         url.addParameter(Constants.PARAM_TYPE_ID, typeId);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         Map<String, Object> json = parseObject(resp.getStream(), resp.getCharset());
 
         return JSONConverter.convertTypeDefinition(json);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/AclServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/AclServiceImpl.java?rev=1423147&r1=1423146&r2=1423147&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/AclServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/AclServiceImpl.java Mon Dec 17 21:12:52 2012
@@ -24,7 +24,8 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.chemistry.opencmis.client.bindings.spi.BindingSession;
-import org.apache.chemistry.opencmis.client.bindings.spi.http.HttpUtils;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Output;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Response;
 import org.apache.chemistry.opencmis.commons.data.Ace;
 import org.apache.chemistry.opencmis.commons.data.Acl;
 import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
@@ -54,7 +55,7 @@ public class AclServiceImpl extends Abst
         url.addParameter(Constants.PARAM_ONLY_BASIC_PERMISSIONS, onlyBasicPermissions);
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         Map<String, Object> json = parseObject(resp.getStream(), resp.getCharset());
 
         return JSONConverter.convertAcl(json, null);
@@ -72,7 +73,7 @@ public class AclServiceImpl extends Abst
         formData.addParameter(Constants.PARAM_ACL_PROPAGATION, aclPropagation);
 
         // send and parse
-        HttpUtils.Response resp = post(url, formData.getContentType(), new HttpUtils.Output() {
+        Response resp = post(url, formData.getContentType(), new Output() {
             public void write(OutputStream out) throws Exception {
                 formData.write(out);
             }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/DiscoveryServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/DiscoveryServiceImpl.java?rev=1423147&r1=1423146&r2=1423147&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/DiscoveryServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/DiscoveryServiceImpl.java Mon Dec 17 21:12:52 2012
@@ -23,7 +23,8 @@ import java.math.BigInteger;
 import java.util.Map;
 
 import org.apache.chemistry.opencmis.client.bindings.spi.BindingSession;
-import org.apache.chemistry.opencmis.client.bindings.spi.http.HttpUtils;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Output;
+import org.apache.chemistry.opencmis.client.bindings.spi.http.Response;
 import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
 import org.apache.chemistry.opencmis.commons.data.ObjectList;
 import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
@@ -65,7 +66,7 @@ public class DiscoveryServiceImpl extend
         // Important: No succinct flag here!!!
 
         // send and parse
-        HttpUtils.Response resp = post(url, formData.getContentType(), new HttpUtils.Output() {
+        Response resp = post(url, formData.getContentType(), new Output() {
             public void write(OutputStream out) throws Exception {
                 formData.write(out);
             }
@@ -90,7 +91,7 @@ public class DiscoveryServiceImpl extend
         url.addParameter(Constants.PARAM_SUCCINCT, getSuccinctParameter());
 
         // read and parse
-        HttpUtils.Response resp = read(url);
+        Response resp = read(url);
         Map<String, Object> json = parseObject(resp.getStream(), resp.getCharset());
 
         if (changeLogToken != null && json != null) {



Mime
View raw message