Return-Path: Delivered-To: apmail-incubator-abdera-commits-archive@locus.apache.org Received: (qmail 66610 invoked from network); 29 Sep 2006 21:23:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 Sep 2006 21:23:02 -0000 Received: (qmail 63995 invoked by uid 500); 29 Sep 2006 21:23:00 -0000 Delivered-To: apmail-incubator-abdera-commits-archive@incubator.apache.org Received: (qmail 63945 invoked by uid 500); 29 Sep 2006 21:23:00 -0000 Mailing-List: contact abdera-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: abdera-dev@incubator.apache.org Delivered-To: mailing list abdera-commits@incubator.apache.org Received: (qmail 63768 invoked by uid 99); 29 Sep 2006 21:22:59 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Sep 2006 14:22:59 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=5.0 tests=ALL_TRUSTED,NO_REAL_NAME Received: from [140.211.166.113] ([140.211.166.113:59805] helo=eris.apache.org) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id 1C/50-20582-2BE8D154 for ; Fri, 29 Sep 2006 14:22:58 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 824131A9823; Fri, 29 Sep 2006 14:22:56 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r451450 [4/4] - in /incubator/abdera/java/trunk: client/src/test/java/org/apache/abdera/test/client/app/ core/src/main/java/org/apache/abdera/model/ core/src/main/java/org/apache/abdera/parser/ core/src/main/java/org/apache/abdera/util/ cor... Date: Fri, 29 Sep 2006 21:22:54 -0000 To: abdera-commits@incubator.apache.org From: jmsnell@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20060929212256.824131A9823@eris.apache.org> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Modified: incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/ParserTest.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/ParserTest.java?view=diff&rev=451450&r1=451449&r2=451450 ============================================================================== --- incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/ParserTest.java (original) +++ incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/ParserTest.java Fri Sep 29 14:22:50 2006 @@ -34,7 +34,7 @@ return abdera.getParser(); } - public static void testParse() { + public static void testParse() throws Exception { Document feedDoc = getParser().parse(ParserTest.class.getResourceAsStream("/simpleFeed.xml")); assertTrue(feedDoc.getRoot() instanceof Feed); Modified: incubator/abdera/java/trunk/protocol/pom.xml URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/protocol/pom.xml?view=diff&rev=451450&r1=451449&r2=451450 ============================================================================== --- incubator/abdera/java/trunk/protocol/pom.xml (original) +++ incubator/abdera/java/trunk/protocol/pom.xml Fri Sep 29 14:22:50 2006 @@ -39,6 +39,12 @@ + org.apache.abdera + abdera-core + 0.2.0-incubating-SNAPSHOT + compile + + junit junit 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=451450&r1=451449&r2=451450 ============================================================================== --- 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 Fri Sep 29 14:22:50 2006 @@ -17,8 +17,6 @@ */ package org.apache.abdera.protocol; -import java.net.URI; -import java.net.URISyntaxException; import java.util.Date; import java.util.List; import java.util.Map; @@ -27,6 +25,8 @@ import javax.activation.MimeTypeParseException; import org.apache.abdera.protocol.util.ProtocolConstants; +import org.apache.abdera.util.iri.IRI; +import org.apache.abdera.util.iri.IRISyntaxException; public interface Response extends ResponseInfo, ProtocolConstants { @@ -54,7 +54,7 @@ public String getContentLanguage(); - public URI getContentLocation() throws URISyntaxException; + public IRI getContentLocation() throws IRISyntaxException; public long getContentLength(); @@ -62,13 +62,13 @@ public String getAllow(); - public URI getLocation() throws URISyntaxException; + public IRI getLocation() throws IRISyntaxException; public String getSlug(); public Date getDateHeader(String name); - public URI getUriHeader(String name) throws URISyntaxException; + public IRI getUriHeader(String name) throws IRISyntaxException; 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=451450&r1=451449&r2=451450 ============================================================================== --- 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 Fri Sep 29 14:22:50 2006 @@ -17,8 +17,6 @@ */ package org.apache.abdera.protocol.util; -import java.net.URI; -import java.net.URISyntaxException; import java.util.Date; import javax.activation.MimeType; @@ -26,6 +24,8 @@ import org.apache.abdera.protocol.EntityTag; import org.apache.abdera.protocol.Response; +import org.apache.abdera.util.iri.IRI; +import org.apache.abdera.util.iri.IRISyntaxException; public abstract class AbstractResponse implements Response { @@ -58,7 +58,7 @@ return (value != null) ? Long.parseLong(value) : -1; } - public URI getContentLocation() throws URISyntaxException { + public IRI getContentLocation() throws IRISyntaxException { return getUriHeader("Content-Location"); } @@ -84,7 +84,7 @@ return getDateHeader("Last-Modified"); } - public URI getLocation() throws URISyntaxException { + public IRI getLocation() throws IRISyntaxException { return getUriHeader("Location"); } @@ -108,9 +108,9 @@ return ResponseType.select(getStatus()); } - public URI getUriHeader(String name) throws URISyntaxException { + public IRI getUriHeader(String name) throws IRISyntaxException { String value = getHeader(name); - return (value != null) ? new URI(value) : null; + return (value != null) ? new IRI(value) : null; } public boolean isMustRevalidate() { 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=451450&r1=451449&r2=451450 ============================================================================== --- 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 Fri Sep 29 14:22:50 2006 @@ -17,8 +17,6 @@ */ package org.apache.abdera.security.xmlsec; -import java.net.URI; -import java.net.URISyntaxException; import java.security.PrivateKey; import java.security.PublicKey; import java.security.cert.X509Certificate; @@ -31,6 +29,8 @@ import org.apache.abdera.security.SignatureOptions; import org.apache.abdera.security.util.Constants; import org.apache.abdera.security.util.SignatureBase; +import org.apache.abdera.util.iri.IRI; +import org.apache.abdera.util.iri.IRISyntaxException; import org.apache.xml.security.exceptions.XMLSecurityException; import org.apache.xml.security.keys.KeyInfo; import org.apache.xml.security.signature.XMLSignature; @@ -61,13 +61,13 @@ T element, SignatureOptions options) throws XMLSecurityException, - URISyntaxException { + IRISyntaxException { element.setBaseUri(element.getResolvedBaseUri()); org.w3c.dom.Element dom = fomToDom((Element)element.clone(), options); org.w3c.dom.Document domdoc = dom.getOwnerDocument(); PrivateKey signingKey = options.getSigningKey(); X509Certificate cert = options.getCertificate(); - URI baseUri = element.getResolvedBaseUri(); + IRI baseUri = element.getResolvedBaseUri(); XMLSignature sig = new XMLSignature( domdoc, (baseUri != null) ? baseUri.toString() : "", @@ -98,7 +98,7 @@ XMLSignature sig) throws XMLSignatureException, XMLSecurityException, - URISyntaxException { + IRISyntaxException { boolean answer = false; KeyInfo ki = sig.getKeyInfo(); if (ki != null) { @@ -120,7 +120,7 @@ SignatureOptions options) throws XMLSignatureException, XMLSecurityException, - URISyntaxException { + IRISyntaxException { List certs = new ArrayList(); org.w3c.dom.Element dom = fomToDom((Element)element, options); NodeList children = dom.getChildNodes(); @@ -131,7 +131,7 @@ org.w3c.dom.Element el = (org.w3c.dom.Element) node; if (Constants.DSIG_NS.equals(el.getNamespaceURI()) && Constants.LN_SIGNATURE.equals(el.getLocalName())) { - URI baseUri = element.getResolvedBaseUri(); + IRI baseUri = element.getResolvedBaseUri(); XMLSignature sig = new XMLSignature( el, (baseUri != null) ? baseUri.toString() : ""); @@ -164,7 +164,7 @@ SignatureOptions options) throws XMLSignatureException, XMLSecurityException, - URISyntaxException { + IRISyntaxException { boolean answer = false; org.w3c.dom.Element dom = fomToDom((Element)element, options); NodeList children = dom.getChildNodes(); @@ -174,7 +174,7 @@ org.w3c.dom.Element el = (org.w3c.dom.Element) node; if (Constants.DSIG_NS.equals(el.getNamespaceURI()) && Constants.LN_SIGNATURE.equals(el.getLocalName())) { - URI baseUri = element.getResolvedBaseUri(); + IRI baseUri = element.getResolvedBaseUri(); XMLSignature sig = new XMLSignature( el, (baseUri != null) ? baseUri.toString() : ""); 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=451450&r1=451449&r2=451450 ============================================================================== --- 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 Fri Sep 29 14:22:50 2006 @@ -18,7 +18,6 @@ package org.apache.abdera.protocol.server.provider; import java.io.IOException; -import java.net.URI; import javax.security.auth.Subject; @@ -30,6 +29,8 @@ import org.apache.abdera.parser.ParserOptions; import org.apache.abdera.protocol.server.ServiceContext; import org.apache.abdera.protocol.util.AbstractRequest; +import org.apache.abdera.util.iri.IRI; +import org.apache.abdera.util.iri.IRISyntaxException; public abstract class AbstractRequestContext extends AbstractRequest @@ -39,14 +40,14 @@ protected Subject subject; protected Target target; protected final String method; - protected final URI requestUri; - protected final URI baseUri; + protected final IRI requestUri; + protected final IRI baseUri; protected AbstractRequestContext( ServiceContext context, String method, - URI requestUri, - URI baseUri) { + IRI requestUri, + IRI baseUri) { this.context = context; this.method = method; this.baseUri = baseUri; @@ -84,16 +85,20 @@ ParserOptions options) throws ParseException, IOException { + try { return parser.parse( getInputStream(), - (URI)null, options); + null, options); + } catch (IRISyntaxException e) { + throw new ParseException(e); // won't never happen + } } - public URI getBaseUri() { + public IRI getBaseUri() { return baseUri; } - public URI getResolvedUri() { + public IRI getResolvedUri() { return baseUri.resolve(getUri()); } @@ -101,7 +106,7 @@ return method; } - public URI getUri() { + public IRI getUri() { return requestUri; } 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=451450&r1=451449&r2=451450 ============================================================================== --- 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 Fri Sep 29 14:22:50 2006 @@ -17,8 +17,6 @@ */ package org.apache.abdera.protocol.server.provider; -import java.io.IOException; -import java.io.OutputStream; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/RequestContext.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/RequestContext.java?view=diff&rev=451450&r1=451449&r2=451450 ============================================================================== --- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/RequestContext.java (original) +++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/RequestContext.java Fri Sep 29 14:22:50 2006 @@ -20,7 +20,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.Reader; -import java.net.URI; import java.util.List; import javax.security.auth.Subject; @@ -32,6 +31,7 @@ import org.apache.abdera.parser.ParserOptions; import org.apache.abdera.protocol.Request; import org.apache.abdera.protocol.server.ServiceContext; +import org.apache.abdera.util.iri.IRI; public interface RequestContext extends Request { @@ -50,11 +50,11 @@ String getMethod(); - URI getUri(); + IRI getUri(); - URI getResolvedUri(); + IRI getResolvedUri(); - URI getBaseUri(); + IRI getBaseUri(); Object getProperty(Property property); 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=451450&r1=451449&r2=451450 ============================================================================== --- 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 Fri Sep 29 14:22:50 2006 @@ -20,8 +20,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.Reader; -import java.net.URI; -import java.net.URISyntaxException; import java.security.Principal; import java.util.Date; import java.util.Enumeration; @@ -36,6 +34,8 @@ import org.apache.abdera.protocol.server.provider.AbstractRequestContext; import org.apache.abdera.protocol.server.provider.RequestContext; import org.apache.abdera.protocol.server.provider.TargetResolver; +import org.apache.abdera.util.iri.IRI; +import org.apache.abdera.util.iri.IRISyntaxException; public class HttpServletRequestContext extends AbstractRequestContext @@ -181,7 +181,7 @@ request.getLocalPort(); } - private static URI initBaseUri( + private static IRI initBaseUri( ServiceContext context, HttpServletRequest request) { StringBuffer buffer = @@ -199,14 +199,14 @@ // So that .resolve() works appropriately. buffer.append("/"); try { - return new URI(buffer.toString()); - } catch (URISyntaxException e) { + return new IRI(buffer.toString()); + } catch (IRISyntaxException e) { throw new RuntimeException(e); } } - private static URI initRequestUri(HttpServletRequest request) { - URI uri = null; + private static IRI initRequestUri(HttpServletRequest request) { + IRI uri = null; try { StringBuffer buf = new StringBuffer( @@ -214,8 +214,8 @@ String qs = request.getQueryString(); if (qs != null && qs.length() != 0) buf.append("?" + request.getQueryString()); - uri = new URI(buf.toString()); - } catch (URISyntaxException e) {} + uri = new IRI(buf.toString()); + } catch (IRISyntaxException e) {} return uri; } } Modified: incubator/abdera/java/trunk/server/src/test/java/org/apache/abdera/test/server/UtilityTest.java URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/test/java/org/apache/abdera/test/server/UtilityTest.java?view=diff&rev=451450&r1=451449&r2=451450 ============================================================================== --- incubator/abdera/java/trunk/server/src/test/java/org/apache/abdera/test/server/UtilityTest.java (original) +++ incubator/abdera/java/trunk/server/src/test/java/org/apache/abdera/test/server/UtilityTest.java Fri Sep 29 14:22:50 2006 @@ -20,7 +20,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.Reader; -import java.net.URI; import java.security.Principal; import java.util.Date; import java.util.HashMap; @@ -33,6 +32,7 @@ import org.apache.abdera.protocol.server.provider.TargetType; import org.apache.abdera.protocol.server.util.RegexTargetResolver; import org.apache.abdera.protocol.server.util.SimpleSubjectResolver; +import org.apache.abdera.util.iri.IRI; import junit.framework.TestCase; @@ -101,8 +101,8 @@ super( ServiceManager.getInstance().newServiceContext(new HashMap()), "POST", - new URI(request), - new URI(base)); + new IRI(request), + new IRI(base)); subject = context.getSubjectResolver().resolve( (Principal) getProperty(Property.PRINCIPAL));