Return-Path: Delivered-To: apmail-jackrabbit-commits-archive@www.apache.org Received: (qmail 17860 invoked from network); 29 Jan 2008 09:36:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Jan 2008 09:36:00 -0000 Received: (qmail 65121 invoked by uid 500); 29 Jan 2008 09:35:51 -0000 Delivered-To: apmail-jackrabbit-commits-archive@jackrabbit.apache.org Received: (qmail 65089 invoked by uid 500); 29 Jan 2008 09:35:51 -0000 Mailing-List: contact commits-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list commits@jackrabbit.apache.org Received: (qmail 65080 invoked by uid 99); 29 Jan 2008 09:35:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Jan 2008 01:35:51 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Jan 2008 09:35:45 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 145A01A9832; Tue, 29 Jan 2008 01:35:37 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@jackrabbit.apache.org From: jukka@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080129093537.145A01A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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); } } }