From abdera-commits-return-wgregory@example.net Wed May 16 11:38:10 2007 Return-Path: <abdera-commits-return-wgregory@example.net> Delivered-To: wgregory@example.net Received: (qmail 95071 invoked from network); 16 May 2007 11:38:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 16 May 2007 11:38:09 -0000 Received: (qmail 30693 invoked by uid 500); 16 May 2007 11:38:15 -0000 Delivered-To: wgregory@example.net Received: (qmail 30681 invoked by uid 500); 16 May 2007 11:38:15 -0000 Mailing-List: contact wgregory@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:wgregory@example.net> List-Unsubscribe: <mailto:wgregory@example.net> List-Post: <mailto:wgregory@example.net> List-Id: <abdera-commits.incubator.apache.org> Reply-To: wgregory@example.net Delivered-To: mailing list wgregory@example.net Received: (qmail 30672 invoked by uid 99); 16 May 2007 11:38:15 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 May 2007 04:38:15 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 May 2007 04:38:08 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 6DAC31A983E; Wed, 16 May 2007 04:37:48 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r538542 - /incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java Date: Wed, 16 May 2007 11:37:48 -0000 To: wgregory@example.net From: wgregory@example.net X-Mailer: svnmailer-1.1.0 Message-Id: <wgregory@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: ugo Date: Wed May 16 04:37:45 2007 New Revision: 538542 URL: http://svn.apache.org/viewvc?view=rev&rev=538542 Log: Testcase for ABDERA-47 Modified: incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java Modified: incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java?view=diff&rev=538542&r1=538541&r2=538542 ============================================================================== --- incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java (original) +++ incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java Wed May 16 04:37:45 2007 @@ -19,7 +19,10 @@ import java.util.Date; +import org.apache.abdera.Abdera; import org.apache.abdera.model.AtomDate; +import org.apache.abdera.model.Content; +import org.apache.abdera.model.Entry; import org.apache.abdera.util.AbderaConfiguration; import org.apache.abdera.util.URIHelper; @@ -70,5 +73,20 @@ atomNow = AtomDate.valueOf(rfc3339); Date parsed = atomNow.getDate(); assertEquals(now, parsed); + } + + public void testAbderaEncodingHandling() throws Exception { + Abdera abdera = new Abdera(); + Entry entry = abdera.newEntry(); + entry.setId("http://example.com/entry/1"); + entry.setTitle("Whatever"); + entry.setUpdated(new Date()); + Content content = entry.getFactory().newContent(Content.Type.XML); + String s = "<x>" + new Character((char) 224) + "</x>"; + content.setValue(s); + content.setMimeType("application/xml+whatever"); + entry.setContentElement(content); + assertNotNull(entry.getContent()); + assertEquals(s, entry.getContent()); } } From abdera-commits-return-wgregory@example.net Wed May 16 13:59:10 2007 Return-Path: <abdera-commits-return-wgregory@example.net> Delivered-To: wgregory@example.net Received: (qmail 61887 invoked from network); 16 May 2007 13:59:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 16 May 2007 13:59:10 -0000 Received: (qmail 33777 invoked by uid 500); 16 May 2007 13:59:16 -0000 Delivered-To: wgregory@example.net Received: (qmail 33737 invoked by uid 500); 16 May 2007 13:59:16 -0000 Mailing-List: contact wgregory@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:wgregory@example.net> List-Unsubscribe: <mailto:wgregory@example.net> List-Post: <mailto:wgregory@example.net> List-Id: <abdera-commits.incubator.apache.org> Reply-To: wgregory@example.net Delivered-To: mailing list wgregory@example.net Received: (qmail 33724 invoked by uid 99); 16 May 2007 13:59:15 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 May 2007 06:59:15 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 May 2007 06:59:09 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id B9E141A9838; Wed, 16 May 2007 06:58:48 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r538598 - in /incubator/abdera/java/trunk: core/src/test/java/org/apache/abdera/test/core/CoreTest.java parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java parser/src/test/java/org/apache/abdera/test/parser/EncodingTest.java Date: Wed, 16 May 2007 13:58:48 -0000 To: wgregory@example.net From: wgregory@example.net X-Mailer: svnmailer-1.1.0 Message-Id: <wgregory@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: ugo Date: Wed May 16 06:58:46 2007 New Revision: 538598 URL: http://svn.apache.org/viewvc?view=rev&rev=538598 Log: [ABDERA-47] Moved testcase to abdera-parser module so it can be run within Eclipse Added: incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/EncodingTest.java (with props) Modified: incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java Modified: incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java?view=diff&rev=538598&r1=538597&r2=538598 ============================================================================== --- incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java (original) +++ incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java Wed May 16 06:58:46 2007 @@ -19,15 +19,12 @@ import java.util.Date; -import org.apache.abdera.Abdera; +import junit.framework.TestCase; + import org.apache.abdera.model.AtomDate; -import org.apache.abdera.model.Content; -import org.apache.abdera.model.Entry; import org.apache.abdera.util.AbderaConfiguration; import org.apache.abdera.util.URIHelper; -import junit.framework.TestCase; - public class CoreTest extends TestCase { public static void testDefaultConfigurationProperties() { @@ -73,20 +70,5 @@ atomNow = AtomDate.valueOf(rfc3339); Date parsed = atomNow.getDate(); assertEquals(now, parsed); - } - - public void testAbderaEncodingHandling() throws Exception { - Abdera abdera = new Abdera(); - Entry entry = abdera.newEntry(); - entry.setId("http://example.com/entry/1"); - entry.setTitle("Whatever"); - entry.setUpdated(new Date()); - Content content = entry.getFactory().newContent(Content.Type.XML); - String s = "<x>" + new Character((char) 224) + "</x>"; - content.setValue(s); - content.setMimeType("application/xml+whatever"); - entry.setContentElement(content); - assertNotNull(entry.getContent()); - assertEquals(s, entry.getContent()); } } Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java?view=diff&rev=538598&r1=538597&r2=538598 ============================================================================== --- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java (original) +++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java Wed May 16 06:58:46 2007 @@ -21,6 +21,7 @@ import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; +import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; @@ -503,11 +504,11 @@ } - protected Element _parse(String value, IRI baseUri) throws ParseException, IRISyntaxException { + protected Element _parse(String value, IRI baseUri) throws ParseException, IRISyntaxException, UnsupportedEncodingException { if (value == null) return null; FOMFactory fomfactory = (FOMFactory) factory; Parser parser = fomfactory.newParser(); - ByteArrayInputStream bais = new ByteArrayInputStream(value.getBytes()); + ByteArrayInputStream bais = new ByteArrayInputStream(value.getBytes(getXMLStreamReader().getCharacterEncodingScheme())); ParserOptions options = parser.getDefaultParserOptions(); options.setCharset(getXMLStreamReader().getCharacterEncodingScheme()); options.setFactory(fomfactory); Added: incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/EncodingTest.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/EncodingTest.java?view=auto&rev=538598 ============================================================================== --- incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/EncodingTest.java (added) +++ incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/EncodingTest.java Wed May 16 06:58:46 2007 @@ -0,0 +1,36 @@ +/* + * (c) 2007 Joost Technologies B.V. All rights reserved. This code contains + * trade secrets of Joost Technologies B.V. and any unauthorized use or + * disclosure is strictly prohibited. + * + * $Id$ + */ +package org.apache.abdera.test.parser; + +import java.util.Date; + +import org.apache.abdera.Abdera; +import org.apache.abdera.model.Content; +import org.apache.abdera.model.Entry; + +import junit.framework.TestCase; + + +public class EncodingTest extends TestCase { + + public void testContentEncoding() throws Exception { + Abdera abdera = new Abdera(); + Entry entry = abdera.newEntry(); + entry.setId("http://example.com/entry/1"); + entry.setTitle("Whatever"); + entry.setUpdated(new Date()); + Content content = entry.getFactory().newContent(Content.Type.XML); + String s = "<x>" + new Character((char) 224) + "</x>"; + content.setValue(s); + content.setMimeType("application/xml+whatever"); + entry.setContentElement(content); + assertNotNull(entry.getContent()); + assertEquals(s, entry.getContent()); + } + +} Propchange: incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/EncodingTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/EncodingTest.java ------------------------------------------------------------------------------ svn:keywords = Date Revision Author HeadURL Id Propchange: incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/EncodingTest.java ------------------------------------------------------------------------------ svn:mime-type = text/plain From abdera-commits-return-wgregory@example.net Wed May 16 14:00:00 2007 Return-Path: <abdera-commits-return-wgregory@example.net> Delivered-To: wgregory@example.net Received: (qmail 62108 invoked from network); 16 May 2007 14:00:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 16 May 2007 14:00:00 -0000 Received: (qmail 35017 invoked by uid 500); 16 May 2007 14:00:06 -0000 Delivered-To: wgregory@example.net Received: (qmail 34986 invoked by uid 500); 16 May 2007 14:00:06 -0000 Mailing-List: contact wgregory@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:wgregory@example.net> List-Unsubscribe: <mailto:wgregory@example.net> List-Post: <mailto:wgregory@example.net> List-Id: <abdera-commits.incubator.apache.org> Reply-To: wgregory@example.net Delivered-To: mailing list wgregory@example.net Received: (qmail 34977 invoked by uid 99); 16 May 2007 14:00:06 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 May 2007 07:00:06 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 May 2007 06:59:59 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 7B7FA1A9838; Wed, 16 May 2007 06:59:39 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r538599 - /incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/EncodingTest.java Date: Wed, 16 May 2007 13:59:39 -0000 To: wgregory@example.net From: wgregory@example.net X-Mailer: svnmailer-1.1.0 Message-Id: <wgregory@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: ugo Date: Wed May 16 06:59:38 2007 New Revision: 538599 URL: http://svn.apache.org/viewvc?view=rev&rev=538599 Log: Copyright header Modified: incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/EncodingTest.java Modified: incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/EncodingTest.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/EncodingTest.java?view=diff&rev=538599&r1=538598&r2=538599 ============================================================================== --- incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/EncodingTest.java (original) +++ incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/EncodingTest.java Wed May 16 06:59:38 2007 @@ -1,10 +1,20 @@ /* - * (c) 2007 Joost Technologies B.V. All rights reserved. This code contains - * trade secrets of Joost Technologies B.V. and any unauthorized use or - * disclosure is strictly prohibited. - * - * $Id$ - */ +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. The ASF licenses this file to You +* under the Apache License, Version 2.0 (the "License"); you may not +* use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. For additional information regarding +* copyright in this work, please see the NOTICE file in the top level +* directory of this distribution. +*/ package org.apache.abdera.test.parser; import java.util.Date; From abdera-commits-return-wgregory@example.net Wed May 16 14:04:56 2007 Return-Path: <abdera-commits-return-wgregory@example.net> Delivered-To: wgregory@example.net Received: (qmail 64819 invoked from network); 16 May 2007 14:04:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 16 May 2007 14:04:56 -0000 Received: (qmail 47403 invoked by uid 500); 16 May 2007 14:05:02 -0000 Delivered-To: wgregory@example.net Received: (qmail 47388 invoked by uid 500); 16 May 2007 14:05:02 -0000 Mailing-List: contact wgregory@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:wgregory@example.net> List-Unsubscribe: <mailto:wgregory@example.net> List-Post: <mailto:wgregory@example.net> List-Id: <abdera-commits.incubator.apache.org> Reply-To: wgregory@example.net Delivered-To: mailing list wgregory@example.net Received: (qmail 47379 invoked by uid 99); 16 May 2007 14:05:02 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 May 2007 07:05:02 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 May 2007 07:04:56 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id D11891A9838; Wed, 16 May 2007 07:04:35 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn propchange: r538598 - svn:log Date: Wed, 16 May 2007 14:04:35 -0000 To: wgregory@example.net From: wgregory@example.net X-Mailer: svnmailer-1.1.0 Message-Id: <wgregory@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: ugo Revision: 538598 Modified property: svn:log Modified: svn:log at Wed May 16 07:04:35 2007 ------------------------------------------------------------------------------ --- svn:log (original) +++ svn:log Wed May 16 07:04:35 2007 @@ -1 +1,2 @@ -[ABDERA-47] Moved testcase to abdera-parser module so it can be run within Eclipse +[ABDERA-47] Moved testcase to abdera-parser module so it can be run within Eclipse. +Fixed bug by specifying the correct encofing when converting between chars and bytes. From abdera-commits-return-wgregory@example.net Thu May 17 14:17:10 2007 Return-Path: <abdera-commits-return-wgregory@example.net> Delivered-To: wgregory@example.net Received: (qmail 73150 invoked from network); 17 May 2007 14:17:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 17 May 2007 14:17:10 -0000 Received: (qmail 98354 invoked by uid 500); 17 May 2007 14:17:16 -0000 Delivered-To: wgregory@example.net Received: (qmail 98343 invoked by uid 500); 17 May 2007 14:17:16 -0000 Mailing-List: contact wgregory@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:wgregory@example.net> List-Unsubscribe: <mailto:wgregory@example.net> List-Post: <mailto:wgregory@example.net> List-Id: <abdera-commits.incubator.apache.org> Reply-To: wgregory@example.net Delivered-To: mailing list wgregory@example.net Received: (qmail 98334 invoked by uid 99); 17 May 2007 14:17:16 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 May 2007 07:17:16 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 May 2007 07:17:09 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 281541A9838; Thu, 17 May 2007 07:16:49 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r538936 - /incubator/abdera/java/trunk/dependencies/json/pom.xml Date: Thu, 17 May 2007 14:16:49 -0000 To: wgregory@example.net From: wgregory@example.net X-Mailer: svnmailer-1.1.0 Message-Id: <wgregory@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: ugo Date: Thu May 17 07:16:48 2007 New Revision: 538936 URL: http://svn.apache.org/viewvc?view=rev&rev=538936 Log: Fix build error: JSON files used to be copied to "json/json" folder but the class names are "org.json". This was putting Eclipse off. Modified: incubator/abdera/java/trunk/dependencies/json/pom.xml Modified: incubator/abdera/java/trunk/dependencies/json/pom.xml URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/dependencies/json/pom.xml?view=diff&rev=538936&r1=538935&r2=538936 ============================================================================== --- incubator/abdera/java/trunk/dependencies/json/pom.xml (original) +++ incubator/abdera/java/trunk/dependencies/json/pom.xml Thu May 17 07:16:48 2007 @@ -47,7 +47,7 @@ <mkdir dir="${basedir}/target" /> <get src="http://json.org/java/apache.zip" dest="${basedir}/target/apache.zip" usetimestamp="true"/> <unzip src="${basedir}/target/apache.zip" dest="${basedir}/target/generated-sources/main/java" /> - <move file="${basedir}/target/generated-sources/main/java/apache" tofile="${basedir}/target/generated-sources/main/java/json" /> + <move file="${basedir}/target/generated-sources/main/java/apache" tofile="${basedir}/target/generated-sources/main/java/org" /> </tasks> <sourceRoot>${project.build.directory}/generated-sources/main/java</sourceRoot> </configuration> From abdera-commits-return-wgregory@example.net Thu May 17 14:32:57 2007 Return-Path: <abdera-commits-return-wgregory@example.net> Delivered-To: wgregory@example.net Received: (qmail 77512 invoked from network); 17 May 2007 14:32:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 17 May 2007 14:32:57 -0000 Received: (qmail 31486 invoked by uid 500); 17 May 2007 14:33:03 -0000 Delivered-To: wgregory@example.net Received: (qmail 31475 invoked by uid 500); 17 May 2007 14:33:03 -0000 Mailing-List: contact wgregory@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:wgregory@example.net> List-Unsubscribe: <mailto:wgregory@example.net> List-Post: <mailto:wgregory@example.net> List-Id: <abdera-commits.incubator.apache.org> Reply-To: wgregory@example.net Delivered-To: mailing list wgregory@example.net Received: (qmail 31462 invoked by uid 99); 17 May 2007 14:33:03 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 May 2007 07:33:03 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 May 2007 07:32:56 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id AB8C01A9838; Thu, 17 May 2007 07:32:36 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r538942 - /incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/AbstractClientResponse.java Date: Thu, 17 May 2007 14:32:36 -0000 To: wgregory@example.net From: wgregory@example.net X-Mailer: svnmailer-1.1.0 Message-Id: <wgregory@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: ugo Date: Thu May 17 07:32:35 2007 New Revision: 538942 URL: http://svn.apache.org/viewvc?view=rev&rev=538942 Log: Check for null before causing an NPE. Modified: incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/AbstractClientResponse.java Modified: incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/AbstractClientResponse.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/AbstractClientResponse.java?view=diff&rev=538942&r1=538941&r2=538942 ============================================================================== --- incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/AbstractClientResponse.java (original) +++ incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/AbstractClientResponse.java Thu May 17 07:32:35 2007 @@ -80,7 +80,7 @@ String charset = getCharacterEncoding(); if (charset != null) options.setCharset(charset); IRI cl = getContentLocation(); - if (!cl.isAbsolute()) { + if (cl != null && !cl.isAbsolute()) { IRI r = new IRI(getUri()); cl = r.resolve(cl); } From abdera-commits-return-wgregory@example.net Thu May 17 14:33:45 2007 Return-Path: <abdera-commits-return-wgregory@example.net> Delivered-To: wgregory@example.net Received: (qmail 77678 invoked from network); 17 May 2007 14:33:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 17 May 2007 14:33:43 -0000 Received: (qmail 32442 invoked by uid 500); 17 May 2007 14:33:45 -0000 Delivered-To: wgregory@example.net Received: (qmail 32425 invoked by uid 500); 17 May 2007 14:33:45 -0000 Mailing-List: contact wgregory@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:wgregory@example.net> List-Unsubscribe: <mailto:wgregory@example.net> List-Post: <mailto:wgregory@example.net> List-Id: <abdera-commits.incubator.apache.org> Reply-To: wgregory@example.net Delivered-To: mailing list wgregory@example.net Received: (qmail 32342 invoked by uid 99); 17 May 2007 14:33:44 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 May 2007 07:33:44 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 May 2007 07:33:37 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 8700C1A9838; Thu, 17 May 2007 07:33:17 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r538943 - /incubator/abdera/java/trunk/client/src/test/java/org/apache/abdera/test/client/app/AppTest.java Date: Thu, 17 May 2007 14:33:17 -0000 To: wgregory@example.net From: wgregory@example.net X-Mailer: svnmailer-1.1.0 Message-Id: <wgregory@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: ugo Date: Thu May 17 07:33:16 2007 New Revision: 538943 URL: http://svn.apache.org/viewvc?view=rev&rev=538943 Log: Make actual mime types correspond to expected ones in tests. Modified: incubator/abdera/java/trunk/client/src/test/java/org/apache/abdera/test/client/app/AppTest.java Modified: incubator/abdera/java/trunk/client/src/test/java/org/apache/abdera/test/client/app/AppTest.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/client/src/test/java/org/apache/abdera/test/client/app/AppTest.java?view=diff&rev=538943&r1=538942&r2=538943 ============================================================================== --- incubator/abdera/java/trunk/client/src/test/java/org/apache/abdera/test/client/app/AppTest.java (original) +++ incubator/abdera/java/trunk/client/src/test/java/org/apache/abdera/test/client/app/AppTest.java Thu May 17 07:33:16 2007 @@ -185,7 +185,7 @@ try { if (MimeTypeHelper.isMatch( request.getContentType(), - "application/atom+xml")) { + "application/atom+xml;type=entry")) { MimeType type = new MimeType(request.getContentType()); String charset = type.getParameter("charset"); String uri = AppTest.INSTANCE.getBase() + "/collections/entries"; @@ -246,7 +246,7 @@ switch(t) { case ENTRY: try { - if (MimeTypeHelper.isMatch(request.getContentType(), "application/atom+xml")) { + if (MimeTypeHelper.isMatch(request.getContentType(), "application/atom+xml;type=entry")) { Entry entry = feed.getRoot().getEntries().get(target); MimeType type = new MimeType(request.getContentType()); String charset = type.getParameter("charset"); @@ -510,7 +510,7 @@ // submit the changes options = client.getDefaultRequestOptions(); - options.setContentType("application/atom+xml"); + options.setContentType("application/atom+xml;type=entry"); options.setHeader("Connection", "close"); response = client.put(edit_uri, entry, options); From abdera-commits-return-wgregory@example.net Thu May 17 14:37:50 2007 Return-Path: <abdera-commits-return-wgregory@example.net> Delivered-To: wgregory@example.net Received: (qmail 79987 invoked from network); 17 May 2007 14:37:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 17 May 2007 14:37:45 -0000 Received: (qmail 41255 invoked by uid 500); 17 May 2007 14:37:48 -0000 Delivered-To: wgregory@example.net Received: (qmail 41233 invoked by uid 500); 17 May 2007 14:37:48 -0000 Mailing-List: contact wgregory@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:wgregory@example.net> List-Unsubscribe: <mailto:wgregory@example.net> List-Post: <mailto:wgregory@example.net> List-Id: <abdera-commits.incubator.apache.org> Reply-To: wgregory@example.net Delivered-To: mailing list wgregory@example.net Received: (qmail 41195 invoked by uid 99); 17 May 2007 14:37:47 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 May 2007 07:37:47 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 May 2007 07:37:41 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id EE09B1A9838; Thu, 17 May 2007 07:37:20 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r538945 - /incubator/abdera/java/trunk/security/src/test/java/org/apache/abdera/test/security/DSigThirdPartyVerifyTest.java Date: Thu, 17 May 2007 14:37:20 -0000 To: wgregory@example.net From: wgregory@example.net X-Mailer: svnmailer-1.1.0 Message-Id: <wgregory@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: ugo Date: Thu May 17 07:37:20 2007 New Revision: 538945 URL: http://svn.apache.org/viewvc?view=rev&rev=538945 Log: Swap expected and actual values in assertion. Modified: incubator/abdera/java/trunk/security/src/test/java/org/apache/abdera/test/security/DSigThirdPartyVerifyTest.java Modified: incubator/abdera/java/trunk/security/src/test/java/org/apache/abdera/test/security/DSigThirdPartyVerifyTest.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/security/src/test/java/org/apache/abdera/test/security/DSigThirdPartyVerifyTest.java?view=diff&rev=538945&r1=538944&r2=538945 ============================================================================== --- incubator/abdera/java/trunk/security/src/test/java/org/apache/abdera/test/security/DSigThirdPartyVerifyTest.java (original) +++ incubator/abdera/java/trunk/security/src/test/java/org/apache/abdera/test/security/DSigThirdPartyVerifyTest.java Thu May 17 07:37:20 2007 @@ -105,7 +105,7 @@ ClientResponse response = client.post( "http://verisignlabs.com/tg/verify", bre, reqoptions); - assertEquals(response.getStatus(),200); + assertEquals(200, response.getStatus()); Document<Element> result = response.getDocument(); XPath xpath = abdera.getXPath(); From abdera-commits-return-wgregory@example.net Fri May 18 14:23:39 2007 Return-Path: <abdera-commits-return-wgregory@example.net> Delivered-To: wgregory@example.net Received: (qmail 46238 invoked from network); 18 May 2007 14:23:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 18 May 2007 14:23:39 -0000 Received: (qmail 87264 invoked by uid 500); 18 May 2007 14:23:45 -0000 Delivered-To: wgregory@example.net Received: (qmail 87231 invoked by uid 500); 18 May 2007 14:23:45 -0000 Mailing-List: contact wgregory@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:wgregory@example.net> List-Unsubscribe: <mailto:wgregory@example.net> List-Post: <mailto:wgregory@example.net> List-Id: <abdera-commits.incubator.apache.org> Reply-To: wgregory@example.net Delivered-To: mailing list wgregory@example.net Received: (qmail 87222 invoked by uid 99); 18 May 2007 14:23:45 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 May 2007 07:23:45 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 May 2007 07:23:38 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 8CD171A981A; Fri, 18 May 2007 07:23:18 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r539478 - /incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/TargetType.java Date: Fri, 18 May 2007 14:23:18 -0000 To: wgregory@example.net From: wgregory@example.net X-Mailer: svnmailer-1.1.0 Message-Id: <wgregory@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: ugo Date: Fri May 18 07:23:17 2007 New Revision: 539478 URL: http://svn.apache.org/viewvc?view=rev&rev=539478 Log: Added missing check for SERVICE type in TargetType#get method. Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/TargetType.java Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/TargetType.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/TargetType.java?view=diff&rev=539478&r1=539477&r2=539478 ============================================================================== --- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/TargetType.java (original) +++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/TargetType.java Fri May 18 07:23:17 2007 @@ -37,6 +37,7 @@ if (name == null) return null; name = name.toUpperCase(); if (name.equals(UNKNOWN)) return TYPE_UNKNOWN; + if (name.equals(SERVICE)) return TYPE_SERVICE; if (name.equals(COLLECTION)) return TYPE_COLLECTION; if (name.equals(ENTRY)) return TYPE_ENTRY; if (name.equals(MEDIA)) return TYPE_MEDIA; From abdera-commits-return-wgregory@example.net Wed May 23 20:59:32 2007 Return-Path: <abdera-commits-return-wgregory@example.net> Delivered-To: wgregory@example.net Received: (qmail 82571 invoked from network); 23 May 2007 20:59:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 23 May 2007 20:59:32 -0000 Received: (qmail 43019 invoked by uid 500); 23 May 2007 20:59:37 -0000 Delivered-To: wgregory@example.net Received: (qmail 43008 invoked by uid 500); 23 May 2007 20:59:37 -0000 Mailing-List: contact wgregory@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:wgregory@example.net> List-Unsubscribe: <mailto:wgregory@example.net> List-Post: <mailto:wgregory@example.net> List-Id: <abdera-commits.incubator.apache.org> Reply-To: wgregory@example.net Delivered-To: mailing list wgregory@example.net Received: (qmail 42995 invoked by uid 99); 23 May 2007 20:59:37 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 May 2007 13:59:37 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 May 2007 13:59:31 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id C9CC21A981A; Wed, 23 May 2007 13:59:10 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r541071 - in /incubator/abdera/java/trunk: client/src/main/java/org/apache/abdera/protocol/client/ dependencies/i18n/src/main/java/org/apache/abdera/i18n/iri/ protocol/src/main/java/org/apache/abdera/protocol/util/ server/src/main/java/org/... Date: Wed, 23 May 2007 20:59:10 -0000 To: wgregory@example.net From: wgregory@example.net X-Mailer: svnmailer-1.1.0 Message-Id: <wgregory@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: jmsnell Date: Wed May 23 13:59:09 2007 New Revision: 541071 URL: http://svn.apache.org/viewvc?view=rev&rev=541071 Log: The next draft of the APP spec (15) changes the Slug header to use pct-encoding instead of RFC2047. This update accepts RFC2047 and pct-encoded headers, but makes it so that only pct-encoded headers are produced. Also, throw an error when the forbidden LF and CR characters are used in the slug. Modified: incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/RequestOptions.java incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/iri/Constants.java incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/AbstractRequest.java incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/AbstractResponse.java incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/AbstractResponseContext.java Modified: incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/RequestOptions.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/RequestOptions.java?view=diff&rev=541071&r1=541070&r2=541071 ============================================================================== --- incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/RequestOptions.java (original) +++ incubator/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/RequestOptions.java Wed May 23 13:59:09 2007 @@ -26,6 +26,8 @@ import javax.activation.MimeType; +import org.apache.abdera.i18n.iri.Constants; +import org.apache.abdera.i18n.iri.Escaping; import org.apache.abdera.protocol.Request; import org.apache.abdera.protocol.util.AbstractRequest; import org.apache.abdera.protocol.util.CacheControlUtil; @@ -379,14 +381,11 @@ * Sets the value of the Atom Publishing Protocol Slug header */ public void setSlug(String slug) { - setHeader("Slug", slug); - } - - /** - * Sets the value of the Atom Publishing Protocol Slug header - */ - public void setSlug(String slug, String charset) { - setEncodedHeader("Slug", charset, slug); + if (slug.indexOf((char)10) > -1 || + slug.indexOf((char)13) > -1) + throw new IllegalArgumentException( + "The slug must not contain ASCII carriage return or linefeed characters"); + setHeader("Slug", Escaping.encode(slug,Constants.ASCIISANSCRLF)); } /** Modified: incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/iri/Constants.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/iri/Constants.java?view=diff&rev=541071&r1=541070&r2=541071 ============================================================================== --- incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/iri/Constants.java (original) +++ incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/iri/Constants.java Wed May 23 13:59:09 2007 @@ -131,5 +131,8 @@ .set2(0x005B,0x0060) .set2(0x007B,0x007F); + public final static BitSet ASCIISANSCRLF = new ChainableBitSet() + .set2(1, 127) + .clear2(10,13); } Modified: incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/AbstractRequest.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/AbstractRequest.java?view=diff&rev=541071&r1=541070&r2=541071 ============================================================================== --- incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/AbstractRequest.java (original) +++ incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/AbstractRequest.java Wed May 23 13:59:09 2007 @@ -23,6 +23,7 @@ import javax.activation.MimeType; import javax.activation.MimeTypeParseException; +import org.apache.abdera.i18n.iri.Escaping; import org.apache.abdera.protocol.Request; public abstract class AbstractRequest implements Request { @@ -57,7 +58,7 @@ } public String getSlug() { - return EncodingUtil.decode(getHeader("Slug")); + return Escaping.decode(EncodingUtil.decode(getHeader("Slug"))); } public MimeType getContentType() throws MimeTypeParseException { Modified: incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/AbstractResponse.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/AbstractResponse.java?view=diff&rev=541071&r1=541070&r2=541071 ============================================================================== --- incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/AbstractResponse.java (original) +++ incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/AbstractResponse.java Wed May 23 13:59:09 2007 @@ -24,6 +24,7 @@ import org.apache.abdera.protocol.Response; import org.apache.abdera.util.EntityTag; +import org.apache.abdera.i18n.iri.Escaping; import org.apache.abdera.i18n.iri.IRI; import org.apache.abdera.i18n.iri.IRISyntaxException; @@ -192,7 +193,7 @@ } public String getDecodedHeader(String header) { - return EncodingUtil.decode(getHeader(header)); + return Escaping.decode(EncodingUtil.decode(getHeader(header))); } } Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/AbstractResponseContext.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/AbstractResponseContext.java?view=diff&rev=541071&r1=541070&r2=541071 ============================================================================== --- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/AbstractResponseContext.java (original) +++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/AbstractResponseContext.java Wed May 23 13:59:09 2007 @@ -23,6 +23,8 @@ import java.util.List; import java.util.Map; +import org.apache.abdera.i18n.iri.Constants; +import org.apache.abdera.i18n.iri.Escaping; import org.apache.abdera.protocol.server.provider.ResponseContext; import org.apache.abdera.protocol.util.AbstractResponse; import org.apache.abdera.protocol.util.EncodingUtil; @@ -213,16 +215,16 @@ setHeader("Content-Location", uri); } - public void setSlug(String slug, String charset) { - setSlug(EncodingUtil.encode(slug, charset)); - } - public void setSlug(String slug) { if (slug == null) { removeHeader("Slug"); return; } - setHeader("Slug", slug); + if (slug.indexOf((char)10) > -1 || + slug.indexOf((char)13) > -1) + throw new IllegalArgumentException( + "The slug must not contain ASCII carriage return or linefeed characters"); + setHeader("Slug", Escaping.encode(slug, Constants.ASCIISANSCRLF)); } public void setContentType(String type) { From abdera-commits-return-wgregory@example.net Wed May 23 22:18:50 2007 Return-Path: <abdera-commits-return-wgregory@example.net> Delivered-To: wgregory@example.net Received: (qmail 24923 invoked from network); 23 May 2007 22:18:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 23 May 2007 22:18:50 -0000 Received: (qmail 11745 invoked by uid 500); 23 May 2007 22:18:56 -0000 Delivered-To: wgregory@example.net Received: (qmail 11732 invoked by uid 500); 23 May 2007 22:18:55 -0000 Mailing-List: contact wgregory@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:wgregory@example.net> List-Unsubscribe: <mailto:wgregory@example.net> List-Post: <mailto:wgregory@example.net> List-Id: <abdera-commits.incubator.apache.org> Reply-To: wgregory@example.net Delivered-To: mailing list wgregory@example.net Received: (qmail 11723 invoked by uid 99); 23 May 2007 22:18:55 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 May 2007 15:18:55 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 May 2007 15:18:49 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id B12F61A981A; Wed, 23 May 2007 15:18:29 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r541101 - /incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/EntityTag.java Date: Wed, 23 May 2007 22:18:29 -0000 To: wgregory@example.net From: wgregory@example.net X-Mailer: svnmailer-1.1.0 Message-Id: <wgregory@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: jmsnell Date: Wed May 23 15:18:25 2007 New Revision: 541101 URL: http://svn.apache.org/viewvc?view=rev&rev=541101 Log: Utility code for generating Etags using a MD5 hash of source material Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/EntityTag.java Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/EntityTag.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/EntityTag.java?view=diff&rev=541101&r1=541100&r2=541101 ============================================================================== --- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/EntityTag.java (original) +++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/EntityTag.java Wed May 23 15:18:25 2007 @@ -18,11 +18,16 @@ package org.apache.abdera.util; import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.List; +import org.apache.commons.codec.binary.Hex; + /** - * Represents a simple Entity Tag + * Implements an EntityTag. */ public class EntityTag implements Cloneable, @@ -165,4 +170,34 @@ return super.clone(); } + + /** + * Utility method for generating ETags. Works by concatenating the UTF-8 + * bytes of the provided strings then generating an MD5 hash of the result. + */ + public static EntityTag generate(String... material) { + String etag = null; + try { + MessageDigest md = MessageDigest.getInstance("md5"); + for (String s : material) md.update(s.getBytes("utf-8")); + byte[] digest = md.digest(); + etag = new String(Hex.encodeHex(digest)); + } catch (NoSuchAlgorithmException e) { + throw new UnsupportedOperationException( + "The hashing function is not available"); + } catch (UnsupportedEncodingException e) { + // should not happen + throw new RuntimeException("UTF-8 not supported?", e); + } + return new EntityTag(etag); + } + + /** + * Checks that the passed in ETag matches the ETag generated by the + * generate method + */ + public static boolean matches(EntityTag etag, String... material) { + EntityTag etag2 = generate(material); + return EntityTag.matches(etag,etag2); + } } From abdera-commits-return-wgregory@example.net Wed May 23 23:23:22 2007 Return-Path: <abdera-commits-return-wgregory@example.net> Delivered-To: wgregory@example.net Received: (qmail 61165 invoked from network); 23 May 2007 23:23:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 23 May 2007 23:23:21 -0000 Received: (qmail 99687 invoked by uid 500); 23 May 2007 23:23:27 -0000 Delivered-To: wgregory@example.net Received: (qmail 99676 invoked by uid 500); 23 May 2007 23:23:27 -0000 Mailing-List: contact wgregory@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:wgregory@example.net> List-Unsubscribe: <mailto:wgregory@example.net> List-Post: <mailto:wgregory@example.net> List-Id: <abdera-commits.incubator.apache.org> Reply-To: wgregory@example.net Delivered-To: mailing list wgregory@example.net Received: (qmail 99667 invoked by uid 99); 23 May 2007 23:23:27 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 May 2007 16:23:27 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 May 2007 16:23:20 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id C5ABA1A981D; Wed, 23 May 2007 16:22:59 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r541117 [2/2] - in /incubator/abdera/java/trunk: core/src/main/java/org/apache/abdera/model/ core/src/main/java/org/apache/abdera/parser/ core/src/main/java/org/apache/abdera/util/ dependencies/i18n/src/main/java/org/apache/abdera/i18n/iri/... Date: Wed, 23 May 2007 23:22:57 -0000 To: wgregory@example.net From: wgregory@example.net X-Mailer: svnmailer-1.1.0 Message-Id: <wgregory@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategories.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategories.java?view=diff&rev=541117&r1=541116&r2=541117 ============================================================================== --- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategories.java (original) +++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategories.java Wed May 23 16:22:54 2007 @@ -26,7 +26,6 @@ import org.apache.abdera.model.Category; import org.apache.abdera.parser.stax.util.FOMHelper; import org.apache.abdera.i18n.iri.IRI; -import org.apache.abdera.i18n.iri.IRISyntaxException; import org.apache.axiom.om.OMContainer; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMException; @@ -105,8 +104,7 @@ public Category addCategory( String scheme, String term, - String label) - throws IRISyntaxException { + String label) { FOMFactory factory = (FOMFactory) this.factory; Category category = factory.newCategory(this); category.setTerm(term); @@ -120,13 +118,12 @@ return _getChildrenAsSet(CATEGORY); } - public List<Category> getCategories(String scheme) throws IRISyntaxException { + public List<Category> getCategories(String scheme) { return FOMHelper.getCategories(this, scheme); } private List<Category> copyCategoriesWithScheme( - List<Category> cats) - throws IRISyntaxException { + List<Category> cats) { List<Category> newcats = new ArrayList<Category>(); IRI scheme = getScheme(); for (Category cat : cats) { @@ -138,15 +135,15 @@ return newcats; } - public List<Category> getCategoriesWithScheme() throws IRISyntaxException { + public List<Category> getCategoriesWithScheme() { return copyCategoriesWithScheme(getCategories()); } - public List<Category> getCategoriesWithScheme(String scheme) throws IRISyntaxException { + public List<Category> getCategoriesWithScheme(String scheme) { return copyCategoriesWithScheme(getCategories(scheme)); } - public IRI getScheme() throws IRISyntaxException { + public IRI getScheme() { String value = getAttributeValue(SCHEME); return (value != null) ? new IRI(value) : null; } @@ -163,22 +160,22 @@ removeAttribute(FIXED); } - public void setScheme(String scheme) throws IRISyntaxException { + public void setScheme(String scheme) { if (scheme != null) setAttributeValue(SCHEME, new IRI(scheme).toString()); else removeAttribute(SCHEME); } - public IRI getHref() throws IRISyntaxException { + public IRI getHref() { return _getUriValue(getAttributeValue(HREF)); } - public IRI getResolvedHref() throws IRISyntaxException { + public IRI getResolvedHref() { return _resolve(getResolvedBaseUri(), getHref()); } - public void setHref(String href) throws IRISyntaxException { + public void setHref(String href) { if (href != null) setAttributeValue(HREF, (new IRI(href)).toString()); else @@ -186,15 +183,13 @@ } public boolean contains( - String term) - throws IRISyntaxException { + String term) { return contains(term,null); } public boolean contains( String term, - String scheme) - throws IRISyntaxException { + String scheme) { List<Category> categories = getCategories(); IRI catscheme = getScheme(); IRI uri = (scheme != null) ? Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategory.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategory.java?view=diff&rev=541117&r1=541116&r2=541117 ============================================================================== --- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategory.java (original) +++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategory.java Wed May 23 16:22:54 2007 @@ -22,7 +22,6 @@ import org.apache.abdera.model.Category; import org.apache.abdera.util.Constants; import org.apache.abdera.i18n.iri.IRI; -import org.apache.abdera.i18n.iri.IRISyntaxException; import org.apache.axiom.om.OMContainer; import org.apache.axiom.om.OMException; import org.apache.axiom.om.OMFactory; @@ -48,8 +47,7 @@ public FOMCategory( String term, String scheme, - String label) - throws IRISyntaxException { + String label) { this(); setTerm(term); setScheme(scheme); @@ -104,12 +102,12 @@ removeAttribute(TERM); } - public IRI getScheme() throws IRISyntaxException { + public IRI getScheme() { String value = getAttributeValue(SCHEME); return (value != null) ? new IRI(value) : null; } - public void setScheme(String scheme) throws IRISyntaxException { + public void setScheme(String scheme) { if (scheme != null) setAttributeValue(SCHEME, new IRI(scheme).toString()); else Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java?view=diff&rev=541117&r1=541116&r2=541117 ============================================================================== --- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java (original) +++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java Wed May 23 16:22:54 2007 @@ -32,7 +32,6 @@ import org.apache.abdera.util.Constants; import org.apache.abdera.util.MimeTypeHelper; import org.apache.abdera.i18n.iri.IRI; -import org.apache.abdera.i18n.iri.IRISyntaxException; import org.apache.axiom.om.OMContainer; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMException; @@ -56,8 +55,7 @@ public FOMCollection( String title, String href, - String[] accepts) - throws IRISyntaxException { + String[] accepts) { this(); setTitle(title); setHref(href); @@ -130,15 +128,15 @@ return getFirstChild(TITLE); } - public IRI getHref() throws IRISyntaxException { + public IRI getHref() { return _getUriValue(getAttributeValue(HREF)); } - public IRI getResolvedHref() throws IRISyntaxException { + public IRI getResolvedHref() { return _resolve(getResolvedBaseUri(), getHref()); } - public void setHref(String href) throws IRISyntaxException { + public void setHref(String href) { if (href != null) setAttributeValue(HREF, (new IRI(href).toString())); else @@ -242,8 +240,7 @@ } public Categories addCategories( - String href) - throws IRISyntaxException { + String href) { Categories cats = ((FOMFactory)factory).newCategories(); cats.setHref(href); addCategories(cats); @@ -253,8 +250,7 @@ public Categories addCategories( List<Category> categories, boolean fixed, - String scheme) - throws IRISyntaxException { + String scheme) { Categories cats = ((FOMFactory)factory).newCategories(); cats.setFixed(fixed); if (scheme != null) cats.setScheme(scheme); Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java?view=diff&rev=541117&r1=541116&r2=541117 ============================================================================== --- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java (original) +++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java Wed May 23 16:22:54 2007 @@ -28,7 +28,6 @@ import org.apache.abdera.model.Element; import org.apache.abdera.util.Constants; import org.apache.abdera.i18n.iri.IRI; -import org.apache.abdera.i18n.iri.IRISyntaxException; import org.apache.axiom.attachments.utils.DataHandlerUtils; import org.apache.axiom.om.OMContainer; import org.apache.axiom.om.OMElement; @@ -160,15 +159,15 @@ removeAttribute(TYPE); } - public IRI getSrc() throws IRISyntaxException { + public IRI getSrc() { return _getUriValue(getAttributeValue(SRC)); } - public IRI getResolvedSrc() throws IRISyntaxException { + public IRI getResolvedSrc() { return _resolve(getResolvedBaseUri(), getSrc()); } - public void setSrc(String src) throws IRISyntaxException { + public void setSrc(String src) { if (src != null) setAttributeValue(SRC, (new IRI(src)).toString()); else @@ -298,8 +297,7 @@ } @Override - public IRI getBaseUri() - throws IRISyntaxException { + public IRI getBaseUri() { if (Type.XHTML.equals(type)) { Element el = getValueElement(); if (el != null) { @@ -316,8 +314,7 @@ } @Override - public IRI getResolvedBaseUri() - throws IRISyntaxException { + public IRI getResolvedBaseUri() { if (Type.XHTML.equals(type)) { Element el = getValueElement(); if (el != null) { Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDocument.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDocument.java?view=diff&rev=541117&r1=541116&r2=541117 ============================================================================== --- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDocument.java (original) +++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDocument.java Wed May 23 16:22:54 2007 @@ -35,7 +35,6 @@ import org.apache.abdera.model.ElementWrapper; import org.apache.abdera.util.EntityTag; import org.apache.abdera.i18n.iri.IRI; -import org.apache.abdera.i18n.iri.IRISyntaxException; import org.apache.abdera.i18n.lang.InvalidLangTagSyntax; import org.apache.abdera.i18n.lang.Lang; import org.apache.axiom.om.OMComment; @@ -115,7 +114,7 @@ return base; } - public void setBaseUri(String base) throws IRISyntaxException { + public void setBaseUri(String base) { this.base = new IRI(base); } Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java?view=diff&rev=541117&r1=541116&r2=541117 ============================================================================== --- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java (original) +++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java Wed May 23 16:22:54 2007 @@ -52,7 +52,6 @@ import org.apache.abdera.util.MimeTypeHelper; import org.apache.abdera.util.URIHelper; import org.apache.abdera.i18n.iri.IRI; -import org.apache.abdera.i18n.iri.IRISyntaxException; import org.apache.abdera.i18n.lang.InvalidLangTagSyntax; import org.apache.abdera.i18n.lang.Lang; import org.apache.axiom.om.OMAttribute; @@ -228,7 +227,7 @@ setAttributeValue(LANG,language); } - public IRI getBaseUri() throws IRISyntaxException { + public IRI getBaseUri() { IRI uri = _getUriValue(getAttributeValue(BASE)); if (URIHelper.isJavascriptUri(uri) || URIHelper.isMailtoUri(uri)) { uri = null; } @@ -242,7 +241,7 @@ return uri; } - public IRI getResolvedBaseUri() throws IRISyntaxException { + public IRI getResolvedBaseUri() { IRI baseUri = null; IRI uri = _getUriValue(getAttributeValue(BASE)); if (URIHelper.isJavascriptUri(uri) || @@ -263,7 +262,7 @@ setAttributeValue(BASE,_getStringValue(base)); } - public void setBaseUri(String base) throws IRISyntaxException { + public void setBaseUri(String base) { setBaseUri((base != null) ? new IRI(base) : null); } @@ -317,7 +316,7 @@ } } - protected IRI _getUriValue(String v) throws IRISyntaxException { + protected IRI _getUriValue(String v) { return (v != null) ? new IRI(v) : null; } @@ -325,7 +324,7 @@ return (uri != null) ? uri.toString() : null; } - protected IRI _resolve(IRI base, IRI value) throws IRISyntaxException { + protected IRI _resolve(IRI base, IRI value) { if (value == null) return null; if ("".equals(value.toString()) || "#".equals(value.toString()) || @@ -504,7 +503,7 @@ } - protected Element _parse(String value, IRI baseUri) throws ParseException, IRISyntaxException, UnsupportedEncodingException { + protected Element _parse(String value, IRI baseUri) throws ParseException, UnsupportedEncodingException { if (value == null) return null; FOMFactory fomfactory = (FOMFactory) factory; Parser parser = fomfactory.newParser(); Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java?view=diff&rev=541117&r1=541116&r2=541117 ============================================================================== --- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java (original) +++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java Wed May 23 16:22:54 2007 @@ -48,7 +48,6 @@ import org.apache.abdera.util.URIHelper; import org.apache.abdera.i18n.io.InputStreamDataSource; import org.apache.abdera.i18n.iri.IRI; -import org.apache.abdera.i18n.iri.IRISyntaxException; import org.apache.axiom.om.OMContainer; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMException; @@ -124,7 +123,7 @@ return person; } - public Person addAuthor(String name, String email, String uri) throws IRISyntaxException { + public Person addAuthor(String name, String email, String uri) { FOMFactory fomfactory = (FOMFactory) this.factory; Person person = fomfactory.newAuthor(this); person.setName(name); @@ -137,7 +136,7 @@ return _getChildrenAsSet(CATEGORY); } - public List<Category> getCategories(String scheme) throws IRISyntaxException { + public List<Category> getCategories(String scheme) { return FOMHelper.getCategories(this, scheme); } @@ -163,7 +162,7 @@ return category; } - public Category addCategory(String scheme, String term, String label) throws IRISyntaxException { + public Category addCategory(String scheme, String term, String label) { FOMFactory factory = (FOMFactory) this.factory; Category category = factory.newCategory(this); category.setTerm(term); @@ -299,7 +298,7 @@ * @throws MimeTypeParseException * @throws IRISyntaxException */ - public Content setContent(IRI uri, String mediatype) throws MimeTypeParseException, IRISyntaxException { + public Content setContent(IRI uri, String mediatype) throws MimeTypeParseException { FOMFactory factory = (FOMFactory) this.factory; Content content = factory.newContent(new MimeType(mediatype)); content.setSrc(uri.toString()); @@ -327,7 +326,7 @@ String name, String email, String uri) - throws IRISyntaxException { + { FOMFactory fomfactory = (FOMFactory) this.factory; Person person = fomfactory.newContributor(this); person.setName(name); @@ -347,20 +346,20 @@ _removeChildren(ID, false); } - public IRI getId() throws IRISyntaxException { + public IRI getId() { IRIElement id = getIdElement(); return (id != null) ? id.getValue() : null; } - public IRIElement setId(String value) throws IRISyntaxException { + public IRIElement setId(String value) { return setId(value, false); } - public IRIElement newId() throws IRISyntaxException { + public IRIElement newId() { return setId(this.getFactory().newUuidUri(), false); } - public IRIElement setId(String value, boolean normalize) throws IRISyntaxException { + public IRIElement setId(String value, boolean normalize) { if (value == null) { _removeChildren(ID, false); return null; @@ -390,11 +389,11 @@ addChild((OMElement)link); } - public Link addLink(String href) throws IRISyntaxException { + public Link addLink(String href) { return addLink(href, null); } - public Link addLink(String href, String rel) throws IRISyntaxException { + public Link addLink(String href, String rel) { FOMFactory fomfactory = (FOMFactory) factory; Link link = fomfactory.newLink(this); link.setHref(href); @@ -409,7 +408,7 @@ String title, String hreflang, long length) - throws IRISyntaxException, MimeTypeParseException { + throws MimeTypeParseException { FOMFactory fomfactory = (FOMFactory) factory; Link link = fomfactory.newLink(this); link.setHref(href); @@ -739,27 +738,27 @@ return getLink(Link.REL_EDIT_MEDIA); } - public IRI getLinkResolvedHref(String rel) throws IRISyntaxException { + public IRI getLinkResolvedHref(String rel) { Link link = getLink(rel); return (link != null) ? link.getResolvedHref() : null; } - public IRI getAlternateLinkResolvedHref() throws IRISyntaxException { + public IRI getAlternateLinkResolvedHref() { Link link = getAlternateLink(); return (link != null) ? link.getResolvedHref() : null; } - public IRI getEnclosureLinkResolvedHref() throws IRISyntaxException { + public IRI getEnclosureLinkResolvedHref() { Link link = getEnclosureLink(); return (link != null) ? link.getResolvedHref() : null; } - public IRI getEditLinkResolvedHref() throws IRISyntaxException { + public IRI getEditLinkResolvedHref() { Link link = getEditLink(); return (link != null) ? link.getResolvedHref() : null; } - public IRI getEditMediaLinkResolvedHref() throws IRISyntaxException { + public IRI getEditMediaLinkResolvedHref() { Link link = getEditMediaLink(); return (link != null) ? link.getResolvedHref() : null; } - public IRI getSelfLinkResolvedHref() throws IRISyntaxException { + public IRI getSelfLinkResolvedHref() { Link link = getSelfLink(); return (link != null) ? link.getResolvedHref() : null; } @@ -775,7 +774,7 @@ return dh.getInputStream(); } - public IRI getContentSrc() throws IRISyntaxException { + public IRI getContentSrc() { Content content = getContentElement(); return (content != null) ? content.getResolvedSrc() : null; } @@ -815,8 +814,7 @@ public IRI getAlternateLinkResolvedHref( String type, String hreflang) - throws IRISyntaxException, - MimeTypeParseException { + throws MimeTypeParseException { Link link = getAlternateLink(type, hreflang); return (link != null) ? link.getResolvedHref() : null; } @@ -831,8 +829,7 @@ public IRI getEditMediaLinkResolvedHref( String type, String hreflang) - throws IRISyntaxException, - MimeTypeParseException { + throws MimeTypeParseException { Link link = getEditMediaLink(type, hreflang); return (link != null) ? link.getResolvedHref() : null; } Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java?view=diff&rev=541117&r1=541116&r2=541117 ============================================================================== --- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java (original) +++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java Wed May 23 16:22:54 2007 @@ -55,7 +55,6 @@ import org.apache.abdera.util.Constants; import org.apache.abdera.util.MimeTypeHelper; import org.apache.abdera.util.Version; -import org.apache.abdera.i18n.iri.IRISyntaxException; import org.apache.axiom.om.OMContainer; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMFactory; @@ -284,9 +283,7 @@ Generator generator = newGenerator(parent); generator.setVersion(Version.VERSION); generator.setText(Version.APP_NAME); - try { - generator.setUri(Version.URI); - } catch (IRISyntaxException e) { /* Can't happen */ } + generator.setUri(Version.URI); return generator; } Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java?view=diff&rev=541117&r1=541116&r2=541117 ============================================================================== --- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java (original) +++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java Wed May 23 16:22:54 2007 @@ -30,7 +30,6 @@ import org.apache.abdera.model.Source; import org.apache.abdera.util.Constants; import org.apache.abdera.i18n.iri.IRI; -import org.apache.abdera.i18n.iri.IRISyntaxException; import org.apache.axiom.om.OMContainer; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMException; @@ -198,7 +197,7 @@ } }; - public Entry getEntry(String id) throws IRISyntaxException { + public Entry getEntry(String id) { if (id == null) return null; List<Entry> l = getEntries(); for (Entry e : l) { Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMGenerator.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMGenerator.java?view=diff&rev=541117&r1=541116&r2=541117 ============================================================================== --- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMGenerator.java (original) +++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMGenerator.java Wed May 23 16:22:54 2007 @@ -22,7 +22,6 @@ import org.apache.abdera.model.Generator; import org.apache.abdera.util.Constants; import org.apache.abdera.i18n.iri.IRI; -import org.apache.abdera.i18n.iri.IRISyntaxException; import org.apache.axiom.om.OMContainer; import org.apache.axiom.om.OMException; import org.apache.axiom.om.OMFactory; @@ -43,7 +42,7 @@ String value, String version, String uri) - throws IRISyntaxException { + { this(); setText(value); setVersion(version); @@ -89,16 +88,16 @@ super(GENERATOR, parent, factory, builder); } - public IRI getUri() throws IRISyntaxException { + public IRI getUri() { String value = getAttributeValue(AURI); return (value != null) ? new IRI(value) : null; } - public IRI getResolvedUri() throws IRISyntaxException { + public IRI getResolvedUri() { return _resolve(getResolvedBaseUri(), getUri()); } - public void setUri(String uri) throws IRISyntaxException { + public void setUri(String uri) { if (uri != null) setAttributeValue(AURI, (new IRI(uri)).toString()); else Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMIRI.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMIRI.java?view=diff&rev=541117&r1=541116&r2=541117 ============================================================================== --- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMIRI.java (original) +++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMIRI.java Wed May 23 16:22:54 2007 @@ -22,7 +22,6 @@ import org.apache.abdera.model.IRIElement; import org.apache.abdera.util.URIHelper; import org.apache.abdera.i18n.iri.IRI; -import org.apache.abdera.i18n.iri.IRISyntaxException; import org.apache.axiom.om.OMContainer; import org.apache.axiom.om.OMException; import org.apache.axiom.om.OMFactory; @@ -39,7 +38,7 @@ super(qname); } - public FOMIRI(QName qname, String value) throws IRISyntaxException { + public FOMIRI(QName qname, String value) { this(qname); setValue(value); } @@ -70,11 +69,11 @@ super(qname, parent, factory, builder); } - public IRI getValue() throws IRISyntaxException { + public IRI getValue() { return _getUriValue(getText()); } - public void setValue(String iri) throws IRISyntaxException { + public void setValue(String iri) { if (iri != null) setText((new IRI(iri)).toString()); else @@ -82,11 +81,11 @@ } - public IRI getResolvedValue() throws IRISyntaxException { + public IRI getResolvedValue() { return _resolve(getResolvedBaseUri(), getValue()); } - public void setNormalizedValue(String uri) throws IRISyntaxException { + public void setNormalizedValue(String uri) { if (uri != null) setValue(URIHelper.normalize(uri)); else Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMLink.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMLink.java?view=diff&rev=541117&r1=541116&r2=541117 ============================================================================== --- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMLink.java (original) +++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMLink.java Wed May 23 16:22:54 2007 @@ -28,7 +28,6 @@ import org.apache.abdera.util.Constants; import org.apache.abdera.util.URIHelper; import org.apache.abdera.i18n.iri.IRI; -import org.apache.abdera.i18n.iri.IRISyntaxException; import org.apache.axiom.om.OMContainer; import org.apache.axiom.om.OMException; import org.apache.axiom.om.OMFactory; @@ -47,7 +46,7 @@ public FOMLink( String href) - throws IRISyntaxException { + { this(); setHref(href); } @@ -55,7 +54,7 @@ public FOMLink( String href, String rel) - throws IRISyntaxException { + { this(); setHref(href); setRel(rel); @@ -102,15 +101,15 @@ super(qname, parent, factory, builder); } - public IRI getHref() throws IRISyntaxException { + public IRI getHref() { return _getUriValue(getAttributeValue(HREF)); } - public IRI getResolvedHref() throws IRISyntaxException { + public IRI getResolvedHref() { return _resolve(getResolvedBaseUri(), getHref()); } - public void setHref(String href) throws IRISyntaxException { + public void setHref(String href) { if (href != null) setAttributeValue(HREF, (new IRI(href)).toString()); else Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMPerson.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMPerson.java?view=diff&rev=541117&r1=541116&r2=541117 ============================================================================== --- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMPerson.java (original) +++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMPerson.java Wed May 23 16:22:54 2007 @@ -23,7 +23,6 @@ import org.apache.abdera.model.IRIElement; import org.apache.abdera.model.Person; import org.apache.abdera.i18n.iri.IRI; -import org.apache.abdera.i18n.iri.IRISyntaxException; import org.apache.axiom.om.OMContainer; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMException; @@ -52,8 +51,7 @@ QName qname, String name, String email, - String uri) - throws IRISyntaxException { + String uri) { this(qname); setName(name); setEmail(email); @@ -157,7 +155,7 @@ _removeChildren(URI, false); } - public IRIElement setUri(String uri) throws IRISyntaxException { + public IRIElement setUri(String uri) { if (uri != null) { FOMFactory fomfactory = (FOMFactory) factory; IRIElement el = fomfactory.newUri(null); @@ -170,7 +168,7 @@ } } - public IRI getUri() throws IRISyntaxException { + public IRI getUri() { IRIElement iri = getUriElement(); return (iri != null) ? iri.getResolvedValue() : null; } Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMSource.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMSource.java?view=diff&rev=541117&r1=541116&r2=541117 ============================================================================== --- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMSource.java (original) +++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMSource.java Wed May 23 16:22:54 2007 @@ -40,7 +40,6 @@ import org.apache.abdera.util.Constants; import org.apache.abdera.util.URIHelper; import org.apache.abdera.i18n.iri.IRI; -import org.apache.abdera.i18n.iri.IRISyntaxException; import org.apache.axiom.om.OMContainer; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMException; @@ -118,7 +117,7 @@ return person; } - public Person addAuthor(String name, String email, String uri) throws IRISyntaxException { + public Person addAuthor(String name, String email, String uri) { FOMFactory fomfactory = (FOMFactory) this.factory; Person person = fomfactory.newAuthor(this); person.setName(name); @@ -131,7 +130,7 @@ return _getChildrenAsSet(CATEGORY); } - public List<Category> getCategories(String scheme) throws IRISyntaxException { + public List<Category> getCategories(String scheme) { return FOMHelper.getCategories(this, scheme); } @@ -157,7 +156,7 @@ return category; } - public Category addCategory(String scheme, String term, String label) throws IRISyntaxException { + public Category addCategory(String scheme, String term, String label) { FOMFactory factory = (FOMFactory) this.factory; Category category = factory.newCategory(this); category.setTerm(term); @@ -181,7 +180,7 @@ return person; } - public Person addContributor(String name, String email, String uri) throws IRISyntaxException { + public Person addContributor(String name, String email, String uri) { FOMFactory fomfactory = (FOMFactory) this.factory; Person person = fomfactory.newContributor(this); person.setName(name); @@ -201,20 +200,20 @@ _removeChildren(ID, false); } - public IRI getId() throws IRISyntaxException { + public IRI getId() { IRIElement id = getIdElement(); return (id != null) ? id.getValue() : null; } - public IRIElement setId(String value) throws IRISyntaxException { + public IRIElement setId(String value) { return setId(value, false); } - public IRIElement newId() throws IRISyntaxException { + public IRIElement newId() { return setId(this.getFactory().newUuidUri(), false); } - public IRIElement setId(String value, boolean normalize) throws IRISyntaxException { + public IRIElement setId(String value, boolean normalize) { if (value == null) { _removeChildren(ID, false); return null; @@ -244,11 +243,11 @@ addChild((OMElement)link); } - public Link addLink(String href) throws IRISyntaxException { + public Link addLink(String href) { return addLink(href, null); } - public Link addLink(String href, String rel) throws IRISyntaxException { + public Link addLink(String href, String rel) { FOMFactory fomfactory = (FOMFactory) factory; Link link = fomfactory.newLink(this); link.setHref(href); @@ -256,7 +255,7 @@ return link; } - public Link addLink(String href, String rel, String type, String title, String hreflang, long length) throws IRISyntaxException, MimeTypeParseException { + public Link addLink(String href, String rel, String type, String title, String hreflang, long length) throws MimeTypeParseException { FOMFactory fomfactory = (FOMFactory) factory; Link link = fomfactory.newLink(this); link.setHref(href); @@ -459,7 +458,7 @@ String uri, String version, String value) - throws IRISyntaxException { + { FOMFactory fomfactory = (FOMFactory) factory; Generator generator = fomfactory.newGenerator(this); if (uri != null) generator.setUri(uri); @@ -479,7 +478,7 @@ _removeChildren(ICON, false); } - public IRIElement setIcon(String value) throws IRISyntaxException { + public IRIElement setIcon(String value) { if (value == null) { _removeChildren(ICON, false); return null; @@ -490,7 +489,7 @@ return iri; } - public IRI getIcon() throws IRISyntaxException { + public IRI getIcon() { IRIElement iri = getIconElement(); IRI uri = (iri != null) ? iri.getResolvedValue() : null; return (URIHelper.isJavascriptUri(uri) || @@ -508,7 +507,7 @@ _removeChildren(LOGO, false); } - public IRIElement setLogo(String value) throws IRISyntaxException { + public IRIElement setLogo(String value) { if (value == null) { _removeChildren(LOGO, false); return null; @@ -519,7 +518,7 @@ return iri; } - public IRI getLogo() throws IRISyntaxException { + public IRI getLogo() { IRIElement iri = getLogoElement(); IRI uri = (iri != null) ? iri.getResolvedValue() : null; return (URIHelper.isJavascriptUri(uri) || @@ -541,15 +540,15 @@ return getLink(Link.REL_ALTERNATE); } - public IRI getLinkResolvedHref(String rel) throws IRISyntaxException { + public IRI getLinkResolvedHref(String rel) { Link link = getLink(rel); return (link != null) ? link.getResolvedHref() : null; } - public IRI getSelfLinkResolvedHref() throws IRISyntaxException { + public IRI getSelfLinkResolvedHref() { Link link = getSelfLink(); return (link != null) ? link.getResolvedHref() : null; } - public IRI getAlternateLinkResolvedHref() throws IRISyntaxException { + public IRI getAlternateLinkResolvedHref() { Link link = getAlternateLink(); return (link != null) ? link.getResolvedHref() : null; } @@ -590,8 +589,7 @@ public IRI getAlternateLinkResolvedHref( String type, String hreflang) - throws IRISyntaxException, - MimeTypeParseException { + throws MimeTypeParseException { Link link = getAlternateLink(type, hreflang); return (link != null) ? link.getResolvedHref() : null; } Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMText.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMText.java?view=diff&rev=541117&r1=541116&r2=541117 ============================================================================== --- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMText.java (original) +++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMText.java Wed May 23 16:22:54 2007 @@ -24,7 +24,6 @@ import org.apache.abdera.model.Text; import org.apache.abdera.util.Constants; import org.apache.abdera.i18n.iri.IRI; -import org.apache.abdera.i18n.iri.IRISyntaxException; import org.apache.axiom.om.OMContainer; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMException; @@ -174,8 +173,7 @@ } @Override - public IRI getBaseUri() - throws IRISyntaxException { + public IRI getBaseUri() { if (Type.XHTML.equals(type)) { Element el = getValueElement(); if (el != null) { @@ -192,8 +190,7 @@ } @Override - public IRI getResolvedBaseUri() - throws IRISyntaxException { + public IRI getResolvedBaseUri() { if (Type.XHTML.equals(type)) { Element el = getValueElement(); if (el != null) { Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMWorkspace.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMWorkspace.java?view=diff&rev=541117&r1=541116&r2=541117 ============================================================================== --- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMWorkspace.java (original) +++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMWorkspace.java Wed May 23 16:22:54 2007 @@ -27,7 +27,6 @@ import org.apache.abdera.model.Text; import org.apache.abdera.model.Workspace; import org.apache.abdera.util.Constants; -import org.apache.abdera.i18n.iri.IRISyntaxException; import org.apache.axiom.om.OMContainer; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMException; @@ -140,7 +139,7 @@ addChild((OMElement)collection); } - public Collection addCollection(String title, String href) throws IRISyntaxException { + public Collection addCollection(String title, String href) { FOMFactory fomfactory = (FOMFactory) factory; Collection collection = fomfactory.newCollection(this); collection.setTitle(title); Modified: incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/Response.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/Response.java?view=diff&rev=541117&r1=541116&r2=541117 ============================================================================== --- incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/Response.java (original) +++ incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/Response.java Wed May 23 16:22:54 2007 @@ -27,7 +27,6 @@ import org.apache.abdera.protocol.util.ProtocolConstants; import org.apache.abdera.util.EntityTag; import org.apache.abdera.i18n.iri.IRI; -import org.apache.abdera.i18n.iri.IRISyntaxException; public interface Response extends ProtocolConstants { @@ -57,7 +56,7 @@ public String getContentLanguage(); - public IRI getContentLocation() throws IRISyntaxException; + public IRI getContentLocation(); public long getContentLength(); @@ -65,13 +64,13 @@ public String getAllow(); - public IRI getLocation() throws IRISyntaxException; + public IRI getLocation(); public String getSlug(); public Date getDateHeader(String name); - public IRI getUriHeader(String name) throws IRISyntaxException; + public IRI getUriHeader(String name); public String getHeader(String name); Modified: incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/AbstractResponse.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/AbstractResponse.java?view=diff&rev=541117&r1=541116&r2=541117 ============================================================================== --- incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/AbstractResponse.java (original) +++ incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/AbstractResponse.java Wed May 23 16:22:54 2007 @@ -26,7 +26,6 @@ import org.apache.abdera.util.EntityTag; import org.apache.abdera.i18n.iri.Escaping; import org.apache.abdera.i18n.iri.IRI; -import org.apache.abdera.i18n.iri.IRISyntaxException; public abstract class AbstractResponse implements Response { @@ -59,7 +58,7 @@ return (value != null) ? Long.parseLong(value) : -1; } - public IRI getContentLocation() throws IRISyntaxException { + public IRI getContentLocation() { return getUriHeader("Content-Location"); } @@ -85,7 +84,7 @@ return getDateHeader("Last-Modified"); } - public IRI getLocation() throws IRISyntaxException { + public IRI getLocation() { return getUriHeader("Location"); } @@ -109,7 +108,7 @@ return ResponseType.select(getStatus()); } - public IRI getUriHeader(String name) throws IRISyntaxException { + public IRI getUriHeader(String name) { String value = getHeader(name); return (value != null) ? new IRI(value) : null; } Modified: incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/xmlsec/XmlSignature.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/xmlsec/XmlSignature.java?view=diff&rev=541117&r1=541116&r2=541117 ============================================================================== --- incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/xmlsec/XmlSignature.java (original) +++ incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/xmlsec/XmlSignature.java Wed May 23 16:22:54 2007 @@ -30,7 +30,6 @@ import org.apache.abdera.security.util.Constants; import org.apache.abdera.security.util.SignatureBase; import org.apache.abdera.i18n.iri.IRI; -import org.apache.abdera.i18n.iri.IRISyntaxException; import org.apache.xml.security.exceptions.XMLSecurityException; import org.apache.xml.security.keys.KeyInfo; import org.apache.xml.security.signature.XMLSignature; @@ -60,8 +59,7 @@ private <T extends Element>T _sign( T element, SignatureOptions options) - throws XMLSecurityException, - IRISyntaxException { + throws XMLSecurityException{ element.setBaseUri(element.getResolvedBaseUri()); org.w3c.dom.Element dom = fomToDom((Element)element.clone(), options); org.w3c.dom.Document domdoc = dom.getOwnerDocument(); @@ -98,8 +96,7 @@ private boolean is_valid_signature( XMLSignature sig) throws XMLSignatureException, - XMLSecurityException, - IRISyntaxException { + XMLSecurityException { boolean answer = false; KeyInfo ki = sig.getKeyInfo(); if (ki != null) { @@ -120,8 +117,7 @@ T element, SignatureOptions options) throws XMLSignatureException, - XMLSecurityException, - IRISyntaxException { + XMLSecurityException { List<X509Certificate> certs = new ArrayList<X509Certificate>(); org.w3c.dom.Element dom = fomToDom((Element)element, options); NodeList children = dom.getChildNodes(); @@ -164,8 +160,7 @@ Element element, SignatureOptions options) throws XMLSignatureException, - XMLSecurityException, - IRISyntaxException { + XMLSecurityException { boolean answer = false; org.w3c.dom.Element dom = fomToDom((Element)element, options); NodeList children = dom.getChildNodes(); Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/AbstractRequestContext.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/AbstractRequestContext.java?view=diff&rev=541117&r1=541116&r2=541117 ============================================================================== --- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/AbstractRequestContext.java (original) +++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/AbstractRequestContext.java Wed May 23 16:22:54 2007 @@ -30,7 +30,6 @@ import org.apache.abdera.protocol.server.ServiceContext; import org.apache.abdera.protocol.util.AbstractRequest; import org.apache.abdera.i18n.iri.IRI; -import org.apache.abdera.i18n.iri.IRISyntaxException; public abstract class AbstractRequestContext extends AbstractRequest @@ -100,13 +99,9 @@ throws ParseException, IOException { if (document == null) { - try { - return parser.parse( - getInputStream(), - null, options); - } catch (IRISyntaxException e) { - throw new ParseException(e); // won't never happen - } + return parser.parse( + getInputStream(), + null, options); } return document; } Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/servlet/HttpServletRequestContext.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/servlet/HttpServletRequestContext.java?view=diff&rev=541117&r1=541116&r2=541117 ============================================================================== --- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/servlet/HttpServletRequestContext.java (original) +++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/servlet/HttpServletRequestContext.java Wed May 23 16:22:54 2007 @@ -35,7 +35,6 @@ import org.apache.abdera.protocol.server.provider.RequestContext; import org.apache.abdera.protocol.server.provider.TargetResolver; import org.apache.abdera.i18n.iri.IRI; -import org.apache.abdera.i18n.iri.IRISyntaxException; public class HttpServletRequestContext extends AbstractRequestContext @@ -208,24 +207,18 @@ buffer.append(request.getContextPath()); // So that .resolve() works appropriately. buffer.append("/"); - try { - return new IRI(buffer.toString()); - } catch (IRISyntaxException e) { - throw new RuntimeException(e); - } + return new IRI(buffer.toString()); } private static IRI initRequestUri(HttpServletRequest request) { IRI uri = null; - try { - StringBuffer buf = - new StringBuffer( - request.getRequestURI()); - String qs = request.getQueryString(); - if (qs != null && qs.length() != 0) - buf.append("?" + request.getQueryString()); - uri = new IRI(buf.toString()); - } catch (IRISyntaxException e) {} + StringBuffer buf = + new StringBuffer( + request.getRequestURI()); + String qs = request.getQueryString(); + if (qs != null && qs.length() != 0) + buf.append("?" + request.getQueryString()); + uri = new IRI(buf.toString()); return uri; } } From abdera-commits-return-wgregory@example.net Wed May 23 23:23:23 2007 Return-Path: <abdera-commits-return-wgregory@example.net> Delivered-To: wgregory@example.net Received: (qmail 61177 invoked from network); 23 May 2007 23:23:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 23 May 2007 23:23:23 -0000 Received: (qmail 99749 invoked by uid 500); 23 May 2007 23:23:28 -0000 Delivered-To: wgregory@example.net Received: (qmail 99726 invoked by uid 500); 23 May 2007 23:23:28 -0000 Mailing-List: contact wgregory@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:wgregory@example.net> List-Unsubscribe: <mailto:wgregory@example.net> List-Post: <mailto:wgregory@example.net> List-Id: <abdera-commits.incubator.apache.org> Reply-To: wgregory@example.net Delivered-To: mailing list wgregory@example.net Received: (qmail 99717 invoked by uid 99); 23 May 2007 23:23:28 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 May 2007 16:23:28 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 May 2007 16:23:20 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id BD8F01A981C; Wed, 23 May 2007 16:22:59 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r541117 [1/2] - in /incubator/abdera/java/trunk: core/src/main/java/org/apache/abdera/model/ core/src/main/java/org/apache/abdera/parser/ core/src/main/java/org/apache/abdera/util/ dependencies/i18n/src/main/java/org/apache/abdera/i18n/iri/... Date: Wed, 23 May 2007 23:22:57 -0000 To: wgregory@example.net From: wgregory@example.net X-Mailer: svnmailer-1.1.0 Message-Id: <wgregory@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: jmsnell Date: Wed May 23 16:22:54 2007 New Revision: 541117 URL: http://svn.apache.org/viewvc?view=rev&rev=541117 Log: Refactor IRISyntaxException as a RuntimeException. Remove a bunch of now unnecessary throws and catches Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Categories.java incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Category.java incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Collection.java
{'source': 'Apache Software Foundation Public Mail Archives'}