jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r616224 - in /jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons: AbstractSession.java AbstractWorkspace.java
Date Tue, 29 Jan 2008 09:35:36 GMT
Author: jukka
Date: Tue Jan 29 01:35:35 2008
New Revision: 616224

URL: http://svn.apache.org/viewvc?rev=616224&view=rev
Log:
JCR-1350: Add a serializing content handler
    - JCR expects an InvalidSerializedDataException when
      the XML to be imported can not be parsed

Modified:
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractSession.java
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractWorkspace.java

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractSession.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractSession.java?rev=616224&r1=616223&r2=616224&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractSession.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractSession.java
Tue Jan 29 01:35:35 2008
@@ -21,6 +21,7 @@
 import java.io.OutputStream;
 
 import javax.jcr.Credentials;
+import javax.jcr.InvalidSerializedDataException;
 import javax.jcr.Item;
 import javax.jcr.Node;
 import javax.jcr.PathNotFoundException;
@@ -116,11 +117,13 @@
      * @param in input stream to be parsed as XML and imported
      * @param uuidBehavior passed through
      * @throws IOException if an I/O error occurs
-     * @throws RepositoryException if another error occurs
+     * @throws InvalidSerializedDataException if an XML parsing error occurs
+     * @throws RepositoryException if a repository error occurs
      */
     public void importXML(
             String parentAbsPath, InputStream in, int uuidBehavior)
-            throws IOException, RepositoryException {
+            throws IOException, InvalidSerializedDataException,
+            RepositoryException {
         try {
             ContentHandler handler =
                 getImportContentHandler(parentAbsPath, uuidBehavior);
@@ -132,7 +135,7 @@
             } else if (exception instanceof IOException) {
                 throw (IOException) exception;
             } else {
-                throw new RepositoryException("XML import failed", e);
+                throw new InvalidSerializedDataException("XML parse error", e);
             }
         }
     }

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractWorkspace.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractWorkspace.java?rev=616224&r1=616223&r2=616224&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractWorkspace.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractWorkspace.java
Tue Jan 29 01:35:35 2008
@@ -19,6 +19,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 
+import javax.jcr.InvalidSerializedDataException;
 import javax.jcr.RepositoryException;
 import javax.jcr.Workspace;
 
@@ -40,11 +41,13 @@
      * @param in input stream to be parsed as XML and imported
      * @param uuidBehavior passed through
      * @throws IOException if an I/O error occurs
-     * @throws RepositoryException if another error occurs
+     * @throws InvalidSerializedDataException if an XML parsing error occurs
+     * @throws RepositoryException if a repository error occurs
      */
     public void importXML(
             String parentAbsPath, InputStream in, int uuidBehavior)
-            throws IOException, RepositoryException {
+            throws IOException, InvalidSerializedDataException,
+            RepositoryException {
         try {
             ContentHandler handler =
                 getImportContentHandler(parentAbsPath, uuidBehavior);
@@ -56,7 +59,7 @@
             } else if (exception instanceof IOException) {
                 throw (IOException) exception;
             } else {
-                throw new RepositoryException("XML import failed", e);
+                throw new InvalidSerializedDataException("XML parse error", e);
             }
         }
     }



Mime
View raw message