You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fm...@apache.org on 2010/02/26 16:06:24 UTC

svn commit: r916705 - in /incubator/chemistry/trunk/opencmis: opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/atompub/ opencmis-client/opencmis-provider-impl/src/test/java/org/apache/opencmis/client/provider...

Author: fmui
Date: Fri Feb 26 15:06:23 2010
New Revision: 916705

URL: http://svn.apache.org/viewvc?rev=916705&view=rev
Log:
CMIS-129: added getErrorContent() to exceptions

Modified:
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/atompub/AbstractAtomPubService.java
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/atompub/HttpUtils.java
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/atompub/ObjectServiceImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/test/java/org/apache/opencmis/client/provider/misc/ConverterTest.java
    incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisBaseException.java
    incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisConnectionException.java
    incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisConstraintException.java
    incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisContentAlreadyExistsException.java
    incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisFilterNotValidException.java
    incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisInvalidArgumentException.java
    incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisNameConstraintViolationException.java
    incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisNotSupportedException.java
    incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisObjectNotFoundException.java
    incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisPermissionDeniedException.java
    incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisRuntimeException.java
    incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisStorageException.java
    incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisStreamNotSupportedException.java
    incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisUpdateConflictException.java
    incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisVersioningException.java
    incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-impl/src/main/java/org/apache/opencmis/commons/impl/Converter.java

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/atompub/AbstractAtomPubService.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/atompub/AbstractAtomPubService.java?rev=916705&r1=916704&r2=916705&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/atompub/AbstractAtomPubService.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/atompub/AbstractAtomPubService.java Fri Feb 26 15:06:23 2010
@@ -342,20 +342,21 @@
   /**
    * Converts a HTTP status code into an Exception.
    */
-  protected CmisBaseException convertStatusCode(int code, String message, Throwable t) {
+  protected CmisBaseException convertStatusCode(int code, String message, String errorContent,
+      Throwable t) {
     switch (code) {
     case 400:
-      return new CmisInvalidArgumentException(message, t);
+      return new CmisInvalidArgumentException(message, errorContent, t);
     case 404:
-      return new CmisObjectNotFoundException(message, t);
+      return new CmisObjectNotFoundException(message, errorContent, t);
     case 403:
-      return new CmisPermissionDeniedException(message, t);
+      return new CmisPermissionDeniedException(message, errorContent, t);
     case 405:
-      return new CmisNotSupportedException(message, t);
+      return new CmisNotSupportedException(message, errorContent, t);
     case 409:
-      return new CmisConstraintException(message, t);
+      return new CmisConstraintException(message, errorContent, t);
     default:
-      return new CmisRuntimeException(message, t);
+      return new CmisRuntimeException(message, errorContent, t);
     }
   }
 
@@ -427,7 +428,8 @@
 
     // check response code
     if (resp.getResponseCode() != 200) {
-      throw convertStatusCode(resp.getResponseCode(), resp.getResponseMessage(), null);
+      throw convertStatusCode(resp.getResponseCode(), resp.getResponseMessage(), resp
+          .getErrorContent(), null);
     }
 
     return resp;
@@ -442,7 +444,8 @@
 
     // check response code
     if (resp.getResponseCode() != 201) {
-      throw convertStatusCode(resp.getResponseCode(), resp.getResponseMessage(), null);
+      throw convertStatusCode(resp.getResponseCode(), resp.getResponseMessage(), resp
+          .getErrorContent(), null);
     }
 
     return resp;
@@ -457,7 +460,8 @@
 
     // check response code
     if ((resp.getResponseCode() < 200) || (resp.getResponseCode() > 299)) {
-      throw convertStatusCode(resp.getResponseCode(), resp.getResponseMessage(), null);
+      throw convertStatusCode(resp.getResponseCode(), resp.getResponseMessage(), resp
+          .getErrorContent(), null);
     }
 
     return resp;
@@ -472,7 +476,8 @@
 
     // check response code
     if (resp.getResponseCode() != 204) {
-      throw convertStatusCode(resp.getResponseCode(), resp.getResponseMessage(), null);
+      throw convertStatusCode(resp.getResponseCode(), resp.getResponseMessage(), resp
+          .getErrorContent(), null);
     }
   }
 

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/atompub/HttpUtils.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/atompub/HttpUtils.java?rev=916705&r1=916704&r2=916705&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/atompub/HttpUtils.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/atompub/HttpUtils.java Fri Feb 26 15:06:23 2010
@@ -19,7 +19,9 @@
 package org.apache.opencmis.client.provider.spi.atompub;
 
 import java.io.BufferedOutputStream;
+import java.io.IOException;
 import java.io.InputStream;
+import java.io.InputStreamReader;
 import java.io.OutputStream;
 import java.math.BigInteger;
 import java.net.HttpURLConnection;
@@ -146,7 +148,8 @@
       }
 
       // get the response
-      return new Response(respCode, conn.getResponseMessage(), conn.getHeaderFields(), inputStream);
+      return new Response(respCode, conn.getResponseMessage(), conn.getHeaderFields(), inputStream,
+          conn.getErrorStream());
     }
     catch (Exception e) {
       throw new CmisConnectionException("Cannot access " + url + ": " + e.getMessage(), e);
@@ -162,12 +165,15 @@
     private String fResponseMessage;
     private Map<String, List<String>> fHeaders;
     private InputStream fStream;
+    private InputStream fErrorStream;
+    private String fErrorContent;
 
     public Response(int responseCode, String responseMessage, Map<String, List<String>> headers,
-        InputStream stream) {
+        InputStream stream, InputStream errorStream) {
       fResponseCode = responseCode;
       fResponseMessage = responseMessage;
       fStream = stream;
+      fErrorStream = errorStream;
 
       fHeaders = new HashMap<String, List<String>>();
       if (headers != null) {
@@ -175,6 +181,29 @@
           fHeaders.put(e.getKey() == null ? null : e.getKey().toLowerCase(), e.getValue());
         }
       }
+
+      // if there is an error page, get it
+      if (errorStream != null) {
+        String contentType = getContentTypeHeader();
+        if ((contentType != null) && (contentType.toLowerCase().startsWith("text/"))) {
+          StringBuilder sb = new StringBuilder();
+
+          try {
+            InputStreamReader reader = new InputStreamReader(errorStream);
+            char[] buffer = new char[4096];
+            int b;
+            while ((b = reader.read(buffer)) > -1) {
+              sb.append(buffer, 0, b);
+            }
+            reader.close();
+
+            fErrorContent = sb.toString();
+          }
+          catch (IOException e) {
+            fErrorContent = "Unable to retrieve content: " + e.getMessage();
+          }
+        }
+      }
     }
 
     public int getResponseCode() {
@@ -241,6 +270,10 @@
     public InputStream getStream() {
       return fStream;
     }
+
+    public String getErrorContent() {
+      return fErrorContent;
+    }
   }
 
   /**

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/atompub/ObjectServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/atompub/ObjectServiceImpl.java?rev=916705&r1=916704&r2=916705&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/atompub/ObjectServiceImpl.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/atompub/ObjectServiceImpl.java Fri Feb 26 15:06:23 2010
@@ -444,7 +444,8 @@
       return new FailedToDeleteDataImpl();
     }
 
-    throw convertStatusCode(resp.getResponseCode(), resp.getResponseMessage(), null);
+    throw convertStatusCode(resp.getResponseCode(), resp.getResponseMessage(), resp
+        .getErrorContent(), null);
   }
 
   /*
@@ -498,7 +499,8 @@
 
     // check response code
     if ((resp.getResponseCode() != 200) && (resp.getResponseCode() != 206)) {
-      throw convertStatusCode(resp.getResponseCode(), resp.getResponseMessage(), null);
+      throw convertStatusCode(resp.getResponseCode(), resp.getResponseMessage(), resp
+          .getErrorContent(), null);
     }
 
     result.setFilename(null);
@@ -679,7 +681,8 @@
     // check response code
     if ((resp.getResponseCode() != 200) && (resp.getResponseCode() != 201)
         && (resp.getResponseCode() != 204)) {
-      throw convertStatusCode(resp.getResponseCode(), resp.getResponseMessage(), null);
+      throw convertStatusCode(resp.getResponseCode(), resp.getResponseMessage(), resp
+          .getErrorContent(), null);
     }
 
     objectId.setValue(null);

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/test/java/org/apache/opencmis/client/provider/misc/ConverterTest.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/test/java/org/apache/opencmis/client/provider/misc/ConverterTest.java?rev=916705&r1=916704&r2=916705&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/test/java/org/apache/opencmis/client/provider/misc/ConverterTest.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/test/java/org/apache/opencmis/client/provider/misc/ConverterTest.java Fri Feb 26 15:06:23 2010
@@ -23,6 +23,7 @@
 import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
@@ -168,7 +169,7 @@
 
     assertDataObjectsEquals("Object", obj1, obj2);
   }
-  
+
   /**
    * Asserts OpenCMIS data objects.
    */
@@ -180,7 +181,15 @@
       return;
     }
 
-    if ((expected == null) || (actual == null)) {
+    if ((expected == null) && (actual instanceof Collection<?>)) {
+      assertTrue(((Collection<?>) actual).isEmpty());
+      return;
+    }
+    else if ((expected instanceof Collection<?>) && (actual == null)) {
+      assertTrue(((Collection<?>) expected).isEmpty());
+      return;
+    }
+    else if ((expected == null) || (actual == null)) {
       fail("Data object is null! name: " + name + " / expected: " + expected + " / actual: "
           + actual);
     }

Modified: incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisBaseException.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisBaseException.java?rev=916705&r1=916704&r2=916705&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisBaseException.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisBaseException.java Fri Feb 26 15:06:23 2010
@@ -33,6 +33,9 @@
   /** Error code used by the Web Services binding. */
   private BigInteger fCode;
 
+  /** Content the of the error page returned by the AtomPub server. */
+  private String fErrorContent;
+
   /**
    * Default constructor.
    */
@@ -60,6 +63,21 @@
    * 
    * @param message
    *          error message
+   * @param errorContent
+   *          error page content
+   * @param cause
+   *          the cause
+   */
+  public CmisBaseException(String message, String errorContent, Throwable cause) {
+    super(message, cause);
+    fErrorContent = errorContent;
+  }
+
+  /**
+   * Constructor.
+   * 
+   * @param message
+   *          error message
    * @param code
    *          error code
    */
@@ -73,11 +91,24 @@
    * 
    * @param message
    *          error message
+   * @param errorContent
+   *          error page content
+   */
+  public CmisBaseException(String message, String errorContent) {
+    super(message);
+    fErrorContent = errorContent;
+  }
+
+  /**
+   * Constructor.
+   * 
+   * @param message
+   *          error message
    * @param cause
    *          the cause
    */
   public CmisBaseException(String message, Throwable cause) {
-    this(message, null, cause);
+    this(message, (BigInteger) null, cause);
   }
 
   /**
@@ -91,7 +122,7 @@
   }
 
   /**
-   * Returns the error code sent by the CMIS repository.
+   * Returns the error code sent by the CMIS repository (Web Services binding only).
    * 
    * @return error code or <code>null</code> if the CMIS repository didn't send an error code or the
    *         binding doesn't support error codes.
@@ -99,4 +130,14 @@
   public BigInteger getCode() {
     return fCode;
   }
+
+  /**
+   * Returns the content of the error page sent by the web server (AtomPub binding only).
+   * 
+   * @return the content of the error page or <code>null</code> if the server didn't send text
+   *         content.
+   */
+  public String getErrorContent() {
+    return fErrorContent;
+  }
 }

Modified: incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisConnectionException.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisConnectionException.java?rev=916705&r1=916704&r2=916705&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisConnectionException.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisConnectionException.java Fri Feb 26 15:06:23 2010
@@ -38,12 +38,20 @@
     super(message, code, cause);
   }
 
+  public CmisConnectionException(String message, String errorContent) {
+    super(message, errorContent);
+  }
+
   public CmisConnectionException(String message, BigInteger code) {
     super(message, code);
   }
 
+  public CmisConnectionException(String message, String errorContent, Throwable cause) {
+    super(message, errorContent, cause);
+  }
+
   public CmisConnectionException(String message, Throwable cause) {
-    super(message, null, cause);
+    super(message, (BigInteger) null, cause);
   }
 
   public CmisConnectionException(String message) {

Modified: incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisConstraintException.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisConstraintException.java?rev=916705&r1=916704&r2=916705&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisConstraintException.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisConstraintException.java Fri Feb 26 15:06:23 2010
@@ -38,12 +38,20 @@
     super(message, code, cause);
   }
 
+  public CmisConstraintException(String message, String errorContent) {
+    super(message, errorContent);
+  }
+
   public CmisConstraintException(String message, BigInteger code) {
     super(message, code);
   }
 
+  public CmisConstraintException(String message, String errorContent, Throwable cause) {
+    super(message, errorContent, cause);
+  }
+
   public CmisConstraintException(String message, Throwable cause) {
-    super(message, null, cause);
+    super(message, (BigInteger) null, cause);
   }
 
   public CmisConstraintException(String message) {

Modified: incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisContentAlreadyExistsException.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisContentAlreadyExistsException.java?rev=916705&r1=916704&r2=916705&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisContentAlreadyExistsException.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisContentAlreadyExistsException.java Fri Feb 26 15:06:23 2010
@@ -38,12 +38,20 @@
     super(message, code, cause);
   }
 
+  public CmisContentAlreadyExistsException(String message, String errorContent) {
+    super(message, errorContent);
+  }
+
   public CmisContentAlreadyExistsException(String message, BigInteger code) {
     super(message, code);
   }
 
+  public CmisContentAlreadyExistsException(String message, String errorContent, Throwable cause) {
+    super(message, errorContent, cause);
+  }
+
   public CmisContentAlreadyExistsException(String message, Throwable cause) {
-    super(message, null, cause);
+    super(message, (BigInteger) null, cause);
   }
 
   public CmisContentAlreadyExistsException(String message) {

Modified: incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisFilterNotValidException.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisFilterNotValidException.java?rev=916705&r1=916704&r2=916705&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisFilterNotValidException.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisFilterNotValidException.java Fri Feb 26 15:06:23 2010
@@ -38,12 +38,20 @@
     super(message, code, cause);
   }
 
+  public CmisFilterNotValidException(String message, String errorContent) {
+    super(message, errorContent);
+  }
+
   public CmisFilterNotValidException(String message, BigInteger code) {
     super(message, code);
   }
 
+  public CmisFilterNotValidException(String message, String errorContent, Throwable cause) {
+    super(message, errorContent, cause);
+  }
+
   public CmisFilterNotValidException(String message, Throwable cause) {
-    super(message, null, cause);
+    super(message, (BigInteger) null, cause);
   }
 
   public CmisFilterNotValidException(String message) {

Modified: incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisInvalidArgumentException.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisInvalidArgumentException.java?rev=916705&r1=916704&r2=916705&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisInvalidArgumentException.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisInvalidArgumentException.java Fri Feb 26 15:06:23 2010
@@ -38,12 +38,20 @@
     super(message, code, cause);
   }
 
+  public CmisInvalidArgumentException(String message, String errorContent) {
+    super(message, errorContent);
+  }
+
   public CmisInvalidArgumentException(String message, BigInteger code) {
     super(message, code);
   }
 
+  public CmisInvalidArgumentException(String message, String errorContent, Throwable cause) {
+    super(message, errorContent, cause);
+  }
+
   public CmisInvalidArgumentException(String message, Throwable cause) {
-    super(message, null, cause);
+    super(message, (BigInteger) null, cause);
   }
 
   public CmisInvalidArgumentException(String message) {

Modified: incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisNameConstraintViolationException.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisNameConstraintViolationException.java?rev=916705&r1=916704&r2=916705&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisNameConstraintViolationException.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisNameConstraintViolationException.java Fri Feb 26 15:06:23 2010
@@ -38,12 +38,20 @@
     super(message, code, cause);
   }
 
+  public CmisNameConstraintViolationException(String message, String errorContent) {
+    super(message, errorContent);
+  }
+
   public CmisNameConstraintViolationException(String message, BigInteger code) {
     super(message, code);
   }
 
+  public CmisNameConstraintViolationException(String message, String errorContent, Throwable cause) {
+    super(message, errorContent, cause);
+  }
+
   public CmisNameConstraintViolationException(String message, Throwable cause) {
-    super(message, null, cause);
+    super(message, (BigInteger) null, cause);
   }
 
   public CmisNameConstraintViolationException(String message) {

Modified: incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisNotSupportedException.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisNotSupportedException.java?rev=916705&r1=916704&r2=916705&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisNotSupportedException.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisNotSupportedException.java Fri Feb 26 15:06:23 2010
@@ -38,12 +38,20 @@
     super(message, code, cause);
   }
 
+  public CmisNotSupportedException(String message, String errorContent) {
+    super(message, errorContent);
+  }
+
   public CmisNotSupportedException(String message, BigInteger code) {
     super(message, code);
   }
 
+  public CmisNotSupportedException(String message, String errorContent, Throwable cause) {
+    super(message, errorContent, cause);
+  }
+
   public CmisNotSupportedException(String message, Throwable cause) {
-    super(message, null, cause);
+    super(message, (BigInteger) null, cause);
   }
 
   public CmisNotSupportedException(String message) {

Modified: incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisObjectNotFoundException.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisObjectNotFoundException.java?rev=916705&r1=916704&r2=916705&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisObjectNotFoundException.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisObjectNotFoundException.java Fri Feb 26 15:06:23 2010
@@ -38,12 +38,20 @@
     super(message, code, cause);
   }
 
+  public CmisObjectNotFoundException(String message, String errorContent) {
+    super(message, errorContent);
+  }
+
   public CmisObjectNotFoundException(String message, BigInteger code) {
     super(message, code);
   }
 
+  public CmisObjectNotFoundException(String message, String errorContent, Throwable cause) {
+    super(message, errorContent, cause);
+  }
+
   public CmisObjectNotFoundException(String message, Throwable cause) {
-    super(message, null, cause);
+    super(message, (BigInteger) null, cause);
   }
 
   public CmisObjectNotFoundException(String message) {

Modified: incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisPermissionDeniedException.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisPermissionDeniedException.java?rev=916705&r1=916704&r2=916705&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisPermissionDeniedException.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisPermissionDeniedException.java Fri Feb 26 15:06:23 2010
@@ -38,12 +38,20 @@
     super(message, code, cause);
   }
 
+  public CmisPermissionDeniedException(String message, String errorContent) {
+    super(message, errorContent);
+  }
+
   public CmisPermissionDeniedException(String message, BigInteger code) {
     super(message, code);
   }
 
+  public CmisPermissionDeniedException(String message, String errorContent, Throwable cause) {
+    super(message, errorContent, cause);
+  }
+
   public CmisPermissionDeniedException(String message, Throwable cause) {
-    super(message, null, cause);
+    super(message, (BigInteger) null, cause);
   }
 
   public CmisPermissionDeniedException(String message) {

Modified: incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisRuntimeException.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisRuntimeException.java?rev=916705&r1=916704&r2=916705&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisRuntimeException.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisRuntimeException.java Fri Feb 26 15:06:23 2010
@@ -38,12 +38,20 @@
     super(message, code, cause);
   }
 
+  public CmisRuntimeException(String message, String errorContent) {
+    super(message, errorContent);
+  }
+
   public CmisRuntimeException(String message, BigInteger code) {
     super(message, code);
   }
 
+  public CmisRuntimeException(String message, String errorContent, Throwable cause) {
+    super(message, errorContent, cause);
+  }
+
   public CmisRuntimeException(String message, Throwable cause) {
-    super(message, null, cause);
+    super(message, (BigInteger) null, cause);
   }
 
   public CmisRuntimeException(String message) {

Modified: incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisStorageException.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisStorageException.java?rev=916705&r1=916704&r2=916705&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisStorageException.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisStorageException.java Fri Feb 26 15:06:23 2010
@@ -38,12 +38,20 @@
     super(message, code, cause);
   }
 
+  public CmisStorageException(String message, String errorContent) {
+    super(message, errorContent);
+  }
+
   public CmisStorageException(String message, BigInteger code) {
     super(message, code);
   }
 
+  public CmisStorageException(String message, String errorContent, Throwable cause) {
+    super(message, errorContent, cause);
+  }
+
   public CmisStorageException(String message, Throwable cause) {
-    super(message, null, cause);
+    super(message, (BigInteger) null, cause);
   }
 
   public CmisStorageException(String message) {

Modified: incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisStreamNotSupportedException.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisStreamNotSupportedException.java?rev=916705&r1=916704&r2=916705&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisStreamNotSupportedException.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisStreamNotSupportedException.java Fri Feb 26 15:06:23 2010
@@ -38,12 +38,20 @@
     super(message, code, cause);
   }
 
+  public CmisStreamNotSupportedException(String message, String errorContent) {
+    super(message, errorContent);
+  }
+
   public CmisStreamNotSupportedException(String message, BigInteger code) {
     super(message, code);
   }
 
+  public CmisStreamNotSupportedException(String message, String errorContent, Throwable cause) {
+    super(message, errorContent, cause);
+  }
+
   public CmisStreamNotSupportedException(String message, Throwable cause) {
-    super(message, null, cause);
+    super(message, (BigInteger) null, cause);
   }
 
   public CmisStreamNotSupportedException(String message) {

Modified: incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisUpdateConflictException.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisUpdateConflictException.java?rev=916705&r1=916704&r2=916705&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisUpdateConflictException.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisUpdateConflictException.java Fri Feb 26 15:06:23 2010
@@ -38,12 +38,20 @@
     super(message, code, cause);
   }
 
+  public CmisUpdateConflictException(String message, String errorContent) {
+    super(message, errorContent);
+  }
+
   public CmisUpdateConflictException(String message, BigInteger code) {
     super(message, code);
   }
 
+  public CmisUpdateConflictException(String message, String errorContent, Throwable cause) {
+    super(message, errorContent, cause);
+  }
+
   public CmisUpdateConflictException(String message, Throwable cause) {
-    super(message, null, cause);
+    super(message, (BigInteger) null, cause);
   }
 
   public CmisUpdateConflictException(String message) {

Modified: incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisVersioningException.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisVersioningException.java?rev=916705&r1=916704&r2=916705&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisVersioningException.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/exceptions/CmisVersioningException.java Fri Feb 26 15:06:23 2010
@@ -38,12 +38,20 @@
     super(message, code, cause);
   }
 
+  public CmisVersioningException(String message, String errorContent) {
+    super(message, errorContent);
+  }
+
   public CmisVersioningException(String message, BigInteger code) {
     super(message, code);
   }
 
+  public CmisVersioningException(String message, String errorContent, Throwable cause) {
+    super(message, errorContent, cause);
+  }
+
   public CmisVersioningException(String message, Throwable cause) {
-    super(message, null, cause);
+    super(message, (BigInteger) null, cause);
   }
 
   public CmisVersioningException(String message) {

Modified: incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-impl/src/main/java/org/apache/opencmis/commons/impl/Converter.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-impl/src/main/java/org/apache/opencmis/commons/impl/Converter.java?rev=916705&r1=916704&r2=916705&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-impl/src/main/java/org/apache/opencmis/commons/impl/Converter.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-impl/src/main/java/org/apache/opencmis/commons/impl/Converter.java Fri Feb 26 15:06:23 2010
@@ -2271,11 +2271,10 @@
     result.setObject(convert(container.getObjectInFolder()));
 
     List<ObjectInFolderContainer> containerList = new ArrayList<ObjectInFolderContainer>();
-    if (!container.getChildren().isEmpty()) {
-      for (CmisObjectInFolderContainerType containerChild : container.getChildren()) {
-        containerList.add(convert(containerChild));
-      }
+    for (CmisObjectInFolderContainerType containerChild : container.getChildren()) {
+      containerList.add(convert(containerChild));
     }
+
     result.setChildren(containerList);
 
     // handle extensions