abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r451450 [1/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 GMT
Author: jmsnell
Date: Fri Sep 29 14:22:50 2006
New Revision: 451450

URL: http://svn.apache.org/viewvc?view=rev&rev=451450
Log:
Big update.  Replacing URI with the new IRI implementation in the core package.  Everywhere in the API
where URI and URISyntaxException was used now uses IRI and IRISyntaxException.  The IRI impl is largely
a drop in replacement for URI with with similar, and in some respects identical methods to java.net.URI. 
The number of classes affected by this update is too large to list here in the summary.  

The IRI/IDNA/Unicode test cases have been added to the core test suite and all of the test cases are 
passing... at least on my system :-) 

Please please please run your own tests.  The Unicode and IRI implementation is brand new and largely 
untested beyond our own limited test suite.  We need to exercise this code thoroughly to make sure it
is working properly.  Test even the most basic URI stuff as the IRI impl contains it's own new IRI/URI
parsing code that could very well contain bugs.

Modified:
    incubator/abdera/java/trunk/client/src/test/java/org/apache/abdera/test/client/app/AppTest.java
    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
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Content.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Document.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Element.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Entry.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Feed.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Generator.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/IRIElement.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Link.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Person.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Source.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Workspace.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/parser/Parser.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaResult.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractParser.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/URIHelper.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/iri/AbstractScheme.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/iri/HttpScheme.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/iri/IRI.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/iri/IRISyntaxException.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/iri/Scheme.java
    incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/TestSuite.java
    incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appclient/Main.java
    incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appserver/SimpleProvider.java
    incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/simple/Create.java
    incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/simple/TextFilterExample.java
    incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/simple/UnacceptableElementsExample.java
    incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/json/JSONWriter.java
    incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/thread/InReplyTo.java
    incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/thread/ThreadHelper.java
    incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/thread/impl/FOMInReplyTo.java
    incubator/abdera/java/trunk/extensions/src/test/java/org/apache/abdera/test/ext/opensearch/OpenSearchTest.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategories.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCategory.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMCollection.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDiv.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMDocument.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMEntry.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFactory.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMGenerator.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMIRI.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMLink.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMParser.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMPerson.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMSource.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMText.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMWorkspace.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/util/ResolveFunction.java
    incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/AtomConformanceTest.java
    incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/BaseParserTestCase.java
    incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FOMTest.java
    incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FeedParserTest.java
    incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/FeedValidatorTest.java
    incubator/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/stax/ParserTest.java
    incubator/abdera/java/trunk/protocol/pom.xml
    incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/Response.java
    incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/AbstractResponse.java
    incubator/abdera/java/trunk/security/src/main/java/org/apache/abdera/security/xmlsec/XmlSignature.java
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/AbstractRequestContext.java
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/AbstractResponseContext.java
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/RequestContext.java
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/servlet/HttpServletRequestContext.java
    incubator/abdera/java/trunk/server/src/test/java/org/apache/abdera/test/server/UtilityTest.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=451450&r1=451449&r2=451450
==============================================================================
--- 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 Fri Sep 29 14:22:50 2006
@@ -21,7 +21,6 @@
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.URI;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
@@ -48,6 +47,7 @@
 import org.apache.abdera.protocol.client.ClientResponse;
 import org.apache.abdera.test.client.JettyTest;
 import org.apache.abdera.util.MimeTypeHelper;
+import org.apache.abdera.util.iri.IRI;
 
 /**
  * Test to make sure that we can operate as a simple APP client
@@ -219,7 +219,7 @@
             entry.addLink(entry.getId().toString(), "edit");
             entry.addLink(AppTest.INSTANCE.getBase() + "/collections/media/" + n, "edit-media").setMimeType("text/plain");
             entry.addLink(entry.getId().toString(), "self");
-            entry.setContent(new URI(AppTest.INSTANCE.getBase() + "/collections/media/" + n), "text/plain");
+            entry.setContent(new IRI(AppTest.INSTANCE.getBase() + "/collections/media/" + n), "text/plain");
             feed.getRoot().insertEntry(entry);
             this.media.put(entry.getId().toString(), media);
             response.setStatus(HttpServletResponse.SC_CREATED);

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Categories.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Categories.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Categories.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Categories.java Fri Sep 29 14:22:50 2006
@@ -17,30 +17,35 @@
 */
 package org.apache.abdera.model;
 
-import java.net.URI;
-import java.net.URISyntaxException;
+import java.io.IOException;
 import java.util.List;
 
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
+
 public interface Categories 
   extends ExtensibleElement {
 
   /**
    * Returns the value of the href attribute
+   * @throws IOException 
    * @throws URISyntaxException 
    */
-  URI getHref() throws URISyntaxException;
+  IRI getHref() throws IRISyntaxException;
   
   /**
    * Returns the fully resolved href
+   * @throws IOException 
    * @throws URISyntaxException 
    */
-  URI getResolvedHref() throws URISyntaxException;
+  IRI getResolvedHref() throws IRISyntaxException;
   
   /**
    * Sets the value of the href attribute
+   * @throws IOException 
    * @throws URISyntaxException 
    */
-  void setHref(String href) throws URISyntaxException;
+  void setHref(String href) throws IRISyntaxException;
   
   /**
    * Specifies whether or not this is a fixed listing of categories
@@ -54,15 +59,18 @@
   
   /**
    * Returns the common scheme for this listing of categories
+   * @throws IOException 
+   * @throws IRISyntaxException 
    * @throws URISyntaxException 
    */
-  URI getScheme() throws URISyntaxException;
+  IRI getScheme() throws IRISyntaxException;
   
   /**
    * Sets the common scheme for this listing of categories
+   * @throws IOException 
    * @throws URISyntaxException 
    */
-  void setScheme(String scheme) throws URISyntaxException;
+  void setScheme(String scheme) throws IRISyntaxException;
 
   /**
    * Lists the complete set of categories
@@ -73,32 +81,34 @@
    * Lists the complete set of categories using the specified scheme
    * @throws URISyntaxException 
    */
-  List<Category> getCategories(String scheme) throws URISyntaxException;
+  List<Category> getCategories(String scheme) throws IRISyntaxException;
   
   /**
    * Returns a copy of the complete set of categories with the scheme attribute set
    * as specified in 7.2.1. (child categories that do not have a scheme
    * attribute inherit the scheme attribute of the parent)
+   * @throws IOException 
    * @throws URISyntaxException 
    */
-  List<Category> getCategoriesWithScheme() throws URISyntaxException;
+  List<Category> getCategoriesWithScheme() throws IRISyntaxException;
 
   /**
    * Returns a copy of the complete set of categories with the scheme 
    * attribute set as specified in 7.2.1. (child categories that do not have a 
    * scheme attribute inherit the scheme attribute of the parent)
+   * @throws IRISyntaxException 
    */
-  List<Category> getCategoriesWithScheme(String scheme) throws URISyntaxException;
+  List<Category> getCategoriesWithScheme(String scheme) throws IRISyntaxException;
   
   void addCategory(Category category);
 
   Category addCategory(String term);
 
-  Category addCategory(String scheme, String term, String label) throws URISyntaxException;
+  Category addCategory(String scheme, String term, String label) throws IRISyntaxException;
     
-  boolean contains(String term) throws URISyntaxException;
+  boolean contains(String term) throws IRISyntaxException;
   
-  boolean contains(String term, String scheme) throws URISyntaxException;
+  boolean contains(String term, String scheme) throws IRISyntaxException;
   
 }
 

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Category.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Category.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Category.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Category.java Fri Sep 29 14:22:50 2006
@@ -17,8 +17,10 @@
 */
 package org.apache.abdera.model;
 
-import java.net.URI;
-import java.net.URISyntaxException;
+import java.io.IOException;
+
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
 
 /**
  * <p>Provides categorization informaton for a feed or entry</p>
@@ -61,8 +63,10 @@
    * RFC4287: The "scheme" attribute is an IRI that identifies a 
    * categorization scheme.  Category elements MAY have a "scheme" 
    * attribute.
+   * @throws IOException 
+   * @throws IRISyntaxException 
    */
-  URI getScheme() throws URISyntaxException;
+  IRI getScheme() throws IRISyntaxException;
 
   /**
    * RFC4287: The "scheme" attribute is an IRI that identifies a 
@@ -70,7 +74,7 @@
    * attribute.
    * @throws URISyntaxException 
    */
-  void setScheme(String scheme) throws URISyntaxException;
+  void setScheme(String scheme) throws IRISyntaxException;
  
   /**
    * RFC4287: The "label" attribute provides a human-readable label 

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Collection.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Collection.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Collection.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Collection.java Fri Sep 29 14:22:50 2006
@@ -17,12 +17,13 @@
 */
 package org.apache.abdera.model;
 
-import java.net.URI;
-import java.net.URISyntaxException;
 import java.util.List;
 
 import javax.activation.MimeType;
 
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
+
 /**
  * <p>Represents an collection element in an Atom Publishing Protocol 
  * introspection document.</p>
@@ -54,11 +55,11 @@
   
   Text getTitleElement();
 
-  URI getHref() throws URISyntaxException;
+  IRI getHref() throws IRISyntaxException;
 
-  URI getResolvedHref() throws URISyntaxException;
+  IRI getResolvedHref() throws IRISyntaxException;
   
-  void setHref(String href) throws URISyntaxException;
+  void setHref(String href) throws IRISyntaxException;
 
   Element getAcceptElement();
   
@@ -74,10 +75,10 @@
   
   Categories addCategories();
   
-  Categories addCategories(String href) throws URISyntaxException;
+  Categories addCategories(String href) throws IRISyntaxException;
   
   void addCategories(Categories categories);
   
-  Categories addCategories(List<Category> categories, boolean fixed, String scheme) throws URISyntaxException;
+  Categories addCategories(List<Category> categories, boolean fixed, String scheme) throws IRISyntaxException;
   
 }

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Content.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Content.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Content.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Content.java Fri Sep 29 14:22:50 2006
@@ -17,14 +17,13 @@
 */
 package org.apache.abdera.model;
 
-import java.net.URI;
-import java.net.URISyntaxException;
-
 import javax.activation.DataHandler;
 import javax.activation.MimeType;
 import javax.activation.MimeTypeParseException;
 
 import org.apache.abdera.util.MimeTypeHelper;
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
 
 /**
  * <p>Represents an atom:content element.</p>
@@ -164,12 +163,12 @@
    * provided and MUST be a MIME media type, rather than "text", "html", 
    * or "xhtml".</p>
    */
-  URI getSrc() throws URISyntaxException;
+  IRI getSrc() throws IRISyntaxException;
   
   /**
    * Returns the fully qualified URI form of the content src attribute.
    */
-  URI getResolvedSrc() throws URISyntaxException;
+  IRI getResolvedSrc() throws IRISyntaxException;
 
   /**
    * <p>RFC4287: atom:content MAY have a "src" attribute, whose value MUST 
@@ -183,7 +182,7 @@
    * or "xhtml".</p>
    * @throws URISyntaxException 
    */
-  void setSrc(String src) throws URISyntaxException;
+  void setSrc(String src) throws IRISyntaxException;
   
   /**
    * Attempts to Base64 decode the string value of the content element.

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Document.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Document.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Document.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Document.java Fri Sep 29 14:22:50 2006
@@ -18,13 +18,14 @@
 package org.apache.abdera.model;
 
 import java.io.Serializable;
-import java.net.URI;
-import java.net.URISyntaxException;
 import java.util.Date;
 
 import javax.activation.MimeType;
 import javax.activation.MimeTypeParseException;
 
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
+
 /**
  * <p>The top level artifact of the Feed Object Model.  The Parser component
  * processes data from an InputStream and returns a Document instance.  The 
@@ -50,14 +51,14 @@
    * Returns the Base URI of the document.  All relative URI's contained in the
    * document will be resolved according to this base.
    */
-  URI getBaseUri();
+  IRI getBaseUri();
   
   /**
    * Sets the Base URI of the document.  All relative URI's contained in the 
    * document will be resolved according to this base.
    * @throws URISyntaxException 
    */
-  void setBaseUri(String base) throws URISyntaxException;
+  void setBaseUri(String base) throws IRISyntaxException;
   
   /**
    * Returns the content type of this document

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Element.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Element.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Element.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Element.java Fri Sep 29 14:22:50 2006
@@ -17,13 +17,15 @@
 */
 package org.apache.abdera.model;
 
-import java.net.URI;
-import java.net.URISyntaxException;
+import java.io.IOException;
 import java.util.List;
 import java.util.Locale;
 
 import javax.xml.namespace.QName;
 
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
+
 /**
  * Root interface for all elements in the Feed Object Model
  */
@@ -67,24 +69,28 @@
   /**
    * Returns the value of this element's <code>xml:base</code> attribute or
    * null if <code>xml:base</code> is undefined.
+   * @throws IOException 
+   * @throws IRISyntaxException 
    */
-  URI getBaseUri() throws URISyntaxException;
+  IRI getBaseUri() throws IRISyntaxException;
   
   /**
    * Returns the current in-scope, fully qualified Base URI for this element.
+   * @throws IOException 
    */
-  URI getResolvedBaseUri() throws URISyntaxException;
+  IRI getResolvedBaseUri() throws IRISyntaxException;
   
   /**
    * Sets the value of this element's <code>xml:base</code> attribute.
    */
-  void setBaseUri(URI base);
+  void setBaseUri(IRI base);
   
   /**
    * Sets the value of this element's <code>xml:base</code> attribute.
+   * @throws IOException 
    * @throws URISyntaxException 
    */
-  void setBaseUri(String base) throws URISyntaxException;
+  void setBaseUri(String base) throws IRISyntaxException;
   
   /**
    * Returns the document to which this element belongs

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Entry.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Entry.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Entry.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Entry.java Fri Sep 29 14:22:50 2006
@@ -17,8 +17,6 @@
 */
 package org.apache.abdera.model;
 
-import java.net.URI;
-import java.net.URISyntaxException;
 import java.util.Date;
 import java.util.List;
 
@@ -26,6 +24,9 @@
 import javax.activation.MimeType;
 import javax.activation.MimeTypeParseException;
 
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
+
 /**
  * <p>Represents an Atom Entry element.</p>
  * 
@@ -128,7 +129,7 @@
    * Adds an author
    * @throws URISyntaxException 
    */
-  Person addAuthor(String name, String email, String uri) throws URISyntaxException;
+  Person addAuthor(String name, String email, String uri) throws IRISyntaxException;
   
   /**
    * Lists the complete set of categories listed for the entry
@@ -139,7 +140,7 @@
    * Lists the complete set of categories using the specified scheme
    * @throws URISyntaxException 
    */
-  List<Category> getCategories(String scheme) throws URISyntaxException;
+  List<Category> getCategories(String scheme) throws IRISyntaxException;
 
   /**
    * Adds an individual category to the entry
@@ -155,7 +156,7 @@
    * Adds a category to the entry
    * @throws URISyntaxException 
    */
-  Category addCategory(String scheme, String term, String label) throws URISyntaxException;
+  Category addCategory(String scheme, String term, String label) throws IRISyntaxException;
   
   /**
    * Returns the content for this entry
@@ -223,7 +224,7 @@
    * @throws MimeTypeParseException if the mime type is invalid.
    * @throws URISyntaxException if the URI is invalid.
    */
-  Content setContent(URI uri, String mediatype) throws MimeTypeParseException, URISyntaxException;
+  Content setContent(IRI uri, String mediatype) throws MimeTypeParseException, IRISyntaxException;
   
   /**
    * Returns the text of the content element
@@ -234,7 +235,7 @@
    * Returns the content/@src attribute, if any
    * @throws URISyntaxException 
    */
-  URI getContentSrc() throws URISyntaxException;
+  IRI getContentSrc() throws IRISyntaxException;
   
   /**
    * Returns the content type
@@ -266,7 +267,7 @@
    * Adds an author
    * @throws URISyntaxException 
    */
-  Person addContributor(String name, String email, String uri) throws URISyntaxException;
+  Person addContributor(String name, String email, String uri) throws IRISyntaxException;
   
   /**
    * Returns the universally unique identifier for this entry
@@ -282,19 +283,19 @@
    * Returns the universally unique identifier for this entry
    * @throws URISyntaxException 
    */
-  URI getId() throws URISyntaxException;
+  IRI getId() throws IRISyntaxException;
 
   /**
    * Sets the universally unique identifier for this entry
    * @throws URISyntaxException 
    */
-  IRIElement setId(String id) throws URISyntaxException;
+  IRIElement setId(String id) throws IRISyntaxException;
   
   /**
    * Sets the universally unique identifier for this entry
    * @throws URISyntaxException 
    */
-  IRIElement setId(String id, boolean normalize) throws URISyntaxException;
+  IRIElement setId(String id, boolean normalize) throws IRISyntaxException;
   
   /**
    * Lists the complete set of links for this entry
@@ -311,11 +312,11 @@
    */
   void addLink(Link link);
   
-  Link addLink(String href) throws URISyntaxException;
+  Link addLink(String href) throws IRISyntaxException;
   
-  Link addLink(String href, String rel) throws URISyntaxException;
+  Link addLink(String href, String rel) throws IRISyntaxException;
   
-  Link addLink(String href, String rel, String type, String title, String hreflang, long length) throws URISyntaxException, MimeTypeParseException;
+  Link addLink(String href, String rel, String type, String title, String hreflang, long length) throws IRISyntaxException, MimeTypeParseException;
   
   /**
    * RFC4287: The "atom:published" element is a Date construct indicating an
@@ -622,12 +623,12 @@
    */
   Link getSelfLink();
  
-  URI getLinkResolvedHref(String rel) throws URISyntaxException;
-  URI getAlternateLinkResolvedHref() throws URISyntaxException;
-  URI getAlternateLinkResolvedHref(String type, String hreflang) throws URISyntaxException, MimeTypeParseException;
-  URI getEnclosureLinkResolvedHref() throws URISyntaxException;
-  URI getEditLinkResolvedHref() throws URISyntaxException;
-  URI getEditMediaLinkResolvedHref() throws URISyntaxException;
-  URI getEditMediaLinkResolvedHref(String type, String hreflang) throws URISyntaxException, MimeTypeParseException;
-  URI getSelfLinkResolvedHref() throws URISyntaxException;
+  IRI getLinkResolvedHref(String rel) throws IRISyntaxException;
+  IRI getAlternateLinkResolvedHref() throws IRISyntaxException;
+  IRI getAlternateLinkResolvedHref(String type, String hreflang) throws IRISyntaxException, MimeTypeParseException;
+  IRI getEnclosureLinkResolvedHref() throws IRISyntaxException;
+  IRI getEditLinkResolvedHref() throws IRISyntaxException;
+  IRI getEditMediaLinkResolvedHref() throws IRISyntaxException;
+  IRI getEditMediaLinkResolvedHref(String type, String hreflang) throws IRISyntaxException, MimeTypeParseException;
+  IRI getSelfLinkResolvedHref() throws IRISyntaxException;
 }

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Feed.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Feed.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Feed.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Feed.java Fri Sep 29 14:22:50 2006
@@ -17,10 +17,11 @@
 */
 package org.apache.abdera.model;
 
-import java.net.URISyntaxException;
 import java.util.Comparator;
 import java.util.List;
 
+import org.apache.abdera.util.iri.IRISyntaxException;
+
 /**
  * <p>Represents an Atom Feed Element</p>
  * 
@@ -143,6 +144,6 @@
    * Retrieves the first entry in the feed with the given atom:id value
    * @throws URISyntaxException 
    */
-  Entry getEntry(String id) throws URISyntaxException;
+  Entry getEntry(String id) throws IRISyntaxException;
   
 }

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Generator.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Generator.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Generator.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Generator.java Fri Sep 29 14:22:50 2006
@@ -17,8 +17,9 @@
 */
 package org.apache.abdera.model;
 
-import java.net.URI;
-import java.net.URISyntaxException;
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
+
 
 /**
  * <p>Identifies the software implementation that produced the Atom feed.</p>
@@ -52,13 +53,13 @@
    *  representation that is relevant to that agent.
    * @throws URISyntaxException 
    */
-  URI getUri() throws URISyntaxException;
+  IRI getUri() throws IRISyntaxException;
   
   /**
    * Returns the fully qualified form of the generator element's uri attribute
    * (resolved against the in-scope Base URI)
    */
-  URI getResolvedUri() throws URISyntaxException;
+  IRI getResolvedUri() throws IRISyntaxException;
   
   /**
    *  The atom:generator element MAY have a "uri" attribute whose value
@@ -67,7 +68,7 @@
    *  representation that is relevant to that agent.
    * @throws URISyntaxException 
    */
-  void setUri(String uri) throws URISyntaxException;
+  void setUri(String uri) throws IRISyntaxException;
   
   /**
    * The atom:generator element MAY have a "version" attribute that

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/IRIElement.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/IRIElement.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/IRIElement.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/IRIElement.java Fri Sep 29 14:22:50 2006
@@ -17,8 +17,8 @@
 */
 package org.apache.abdera.model;
 
-import java.net.URI;
-import java.net.URISyntaxException;
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
 
 /**
  * <p>The IRI interface provides a common base for a set of feed and 
@@ -31,20 +31,20 @@
   /**
    * Returns the value of the element as a java.net.URI 
    */
-  URI getValue() throws URISyntaxException;
+  IRI getValue() throws IRISyntaxException;
   
   /**
    * Sets the value of the element
-   * @throws URISyntaxException 
+   * @throws IRISyntaxException 
    */
-  void setValue(String iri) throws URISyntaxException;
+  void setValue(String iri) throws IRISyntaxException;
   
-  void setNormalizedValue(String id) throws URISyntaxException;
+  void setNormalizedValue(String id) throws IRISyntaxException;
   
   /**
    * Returns the value of the element resolved against the current
    * in-scope Base URI
    */
-  URI getResolvedValue() throws URISyntaxException;
+  IRI getResolvedValue() throws IRISyntaxException;
   
 }

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Link.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Link.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Link.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Link.java Fri Sep 29 14:22:50 2006
@@ -17,12 +17,12 @@
 */
 package org.apache.abdera.model;
 
-import java.net.URI;
-import java.net.URISyntaxException;
-
 import javax.activation.MimeType;
 import javax.activation.MimeTypeParseException;
 
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
+
 /**
  * <p>Represents an Atom Link element.</p>
  * 
@@ -88,21 +88,21 @@
    * elements MUST have an href attribute, whose value MUST be a IRI 
    * reference [RFC3987].
    */
-  URI getHref() throws URISyntaxException;
+  IRI getHref() throws IRISyntaxException;
   
   /**
    * Returns the value of the link's href attribute resolved against the 
-   * in-scope Base URI
+   * in-scope Base IRI
    */
-  URI getResolvedHref() throws URISyntaxException;
+  IRI getResolvedHref() throws IRISyntaxException;
   
   /**
    * RFC4287: The "href" attribute contains the link's IRI. atom:link 
    * elements MUST have an href attribute, whose value MUST be a IRI 
    * reference [RFC3987].
-   * @throws URISyntaxException 
+   * @throws IRISyntaxException 
    */
-  void setHref(String href) throws URISyntaxException;
+  void setHref(String href) throws IRISyntaxException;
   
   /**
    * <p>RFC4287: atom:link elements MAY have a "rel" attribute that indicates the link
@@ -201,8 +201,8 @@
   /**
    * RFC4287: The "length" attribute indicates an advisory length of the linked
    * content in octets; it is a hint about the content length of the
-   * representation returned when the IRI in the href attribute is mapped
-   * to a URI and dereferenced.  Note that the length attribute does not
+   * representation returned when the URI in the href attribute is mapped
+   * to a IRI and dereferenced.  Note that the length attribute does not
    * override the actual content length of the representation as reported
    * by the underlying protocol.  Link elements MAY have a length
    * attribute.

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Person.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Person.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Person.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Person.java Fri Sep 29 14:22:50 2006
@@ -17,8 +17,8 @@
 */
 package org.apache.abdera.model;
 
-import java.net.URI;
-import java.net.URISyntaxException;
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
 
 /**
  * <p>An Atom Person Construct</p>
@@ -124,7 +124,7 @@
    * construct MUST be an IRI reference [RFC3987].
    * @throws URISyntaxException 
    */
-  IRIElement setUri(String uri) throws URISyntaxException;
+  IRIElement setUri(String uri) throws IRISyntaxException;
   
   /**
    * The "atom:uri" element's content conveys an IRI associated with the
@@ -133,5 +133,5 @@
    * construct MUST be an IRI reference [RFC3987].
    * @throws URISyntaxException 
    */
-  URI getUri() throws URISyntaxException;
+  IRI getUri() throws IRISyntaxException;
 }

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Source.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Source.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Source.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Source.java Fri Sep 29 14:22:50 2006
@@ -17,13 +17,14 @@
 */
 package org.apache.abdera.model;
 
-import java.net.URI;
-import java.net.URISyntaxException;
 import java.util.Date;
 import java.util.List;
 
 import javax.activation.MimeTypeParseException;
 
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
+
 /**
  * <p>Per RFC4287:</p>
  * 
@@ -89,9 +90,9 @@
 
   /**
    * Adds an author
-   * @throws URISyntaxException 
+   * @throws IRISyntaxException 
    */
-  Person addAuthor(String name, String email, String uri) throws URISyntaxException;
+  Person addAuthor(String name, String email, String IRI) throws IRISyntaxException;
   
   /**
    * Lists the complete set of categories listed for the entry
@@ -100,9 +101,9 @@
   
   /**
    * Lists the complete set of categories using the specified scheme
-   * @throws URISyntaxException 
+   * @throws IRISyntaxException 
    */
-  List<Category> getCategories(String scheme) throws URISyntaxException;
+  List<Category> getCategories(String scheme) throws IRISyntaxException;
   
   /**
    * Adds an individual category to the entry
@@ -116,9 +117,9 @@
 
   /**
    * Adds a category to the feed
-   * @throws URISyntaxException 
+   * @throws IRISyntaxException 
    */
-  Category addCategory(String scheme, String term, String label) throws URISyntaxException;
+  Category addCategory(String scheme, String term, String label) throws IRISyntaxException;
   
   /**
    * Lists the complete set of contributors for this entry
@@ -137,9 +138,9 @@
 
   /**
    * Adds a contributor
-   * @throws URISyntaxException 
+   * @throws IRISyntaxException 
    */
-  Person addContributor(String name, String email, String uri) throws URISyntaxException;
+  Person addContributor(String name, String email, String IRI) throws IRISyntaxException;
   
   /**
    * RFC4287: The "atom:generator" element's content identifies the 
@@ -158,10 +159,10 @@
    * agent used to generate a feed, for debugging and other purposes.
    */
   Generator setGenerator(
-    String uri, 
+    String IRI, 
     String version, 
     String value) 
-      throws URISyntaxException;
+      throws IRISyntaxException;
   
   /** 
    * RFC4287: The "atom:icon" element's content is an IRI reference 
@@ -187,9 +188,9 @@
    *  identification for a feed... The image SHOULD have an aspect ratio 
    *  of one (horizontal) to one (vertical) and SHOULD be suitable for 
    *  presentation at a small size.
-   * @throws URISyntaxException 
+   * @throws IRISyntaxException 
    */
-  IRIElement setIcon(String iri) throws URISyntaxException;
+  IRIElement setIcon(String iri) throws IRISyntaxException;
 
   /** 
    * RFC4287: The "atom:icon" element's content is an IRI reference 
@@ -197,9 +198,9 @@
    *  identification for a feed... The image SHOULD have an aspect ratio 
    *  of one (horizontal) to one (vertical) and SHOULD be suitable for 
    *  presentation at a small size.
-   * @throws URISyntaxException 
+   * @throws IRISyntaxException 
    */
-  URI getIcon() throws URISyntaxException;
+  IRI getIcon() throws IRISyntaxException;
   
   /**
    * RFC4287: The "atom:id" element conveys a permanent, universally unique
@@ -215,21 +216,21 @@
   
   /**
    * Returns the universally unique identifier for this feed
-   * @throws URISyntaxException 
+   * @throws IRISyntaxException 
    */
-  URI getId() throws URISyntaxException;
+  IRI getId() throws IRISyntaxException;
 
   /**
    * Sets the universally unique identifier for this feed
-   * @throws URISyntaxException 
+   * @throws IRISyntaxException 
    */
-  IRIElement setId(String id) throws URISyntaxException;
+  IRIElement setId(String id) throws IRISyntaxException;
   
   /**
    * Sets the universally unique identifier for this feed
-   * @throws URISyntaxException 
+   * @throws IRISyntaxException 
    */
-  IRIElement setId(String id, boolean normalize) throws URISyntaxException;
+  IRIElement setId(String id, boolean normalize) throws IRISyntaxException;
    
   /**
    * Lists the complete set of links for this entry
@@ -246,11 +247,11 @@
    */
   void addLink(Link link);
   
-  Link addLink(String href) throws URISyntaxException;
+  Link addLink(String href) throws IRISyntaxException;
   
-  Link addLink(String href, String rel) throws URISyntaxException;
+  Link addLink(String href, String rel) throws IRISyntaxException;
   
-  Link addLink(String href, String rel, String type, String title, String hreflang, long length) throws URISyntaxException, MimeTypeParseException;
+  Link addLink(String href, String rel, String type, String title, String hreflang, long length) throws IRISyntaxException, MimeTypeParseException;
    
   /**
    * RFC4287: The "atom:logo" element's content is an IRI reference [RFC3987] 
@@ -270,17 +271,17 @@
    * RFC4287: The "atom:logo" element's content is an IRI reference [RFC3987] 
    * that identifies an image that provides visual identification for a feed.
    * The image SHOULD have an aspect ratio of 2 (horizontal) to 1 (vertical).
-   * @throws URISyntaxException 
+   * @throws IRISyntaxException 
    */
-  IRIElement setLogo(String iri) throws URISyntaxException;
+  IRIElement setLogo(String iri) throws IRISyntaxException;
 
   /**
    * RFC4287: The "atom:logo" element's content is an IRI reference [RFC3987] 
    * that identifies an image that provides visual identification for a feed.
    * The image SHOULD have an aspect ratio of 2 (horizontal) to 1 (vertical).
-   * @throws URISyntaxException 
+   * @throws IRISyntaxException 
    */
-  URI getLogo() throws URISyntaxException;
+  IRI getLogo() throws IRISyntaxException;
   
   /**
    * <p>The rights element is typically used to convey a human readable 
@@ -470,10 +471,10 @@
   
   Link getAlternateLink(String type, String hreflang) throws MimeTypeParseException;
   
-  URI getLinkResolvedHref(String rel) throws URISyntaxException;
-  URI getSelfLinkResolvedHref() throws URISyntaxException;
-  URI getAlternateLinkResolvedHref() throws URISyntaxException;
-  URI getAlternateLinkResolvedHref(String type, String hreflang) throws URISyntaxException, MimeTypeParseException;
+  IRI getLinkResolvedHref(String rel) throws IRISyntaxException;
+  IRI getSelfLinkResolvedHref() throws IRISyntaxException;
+  IRI getAlternateLinkResolvedHref() throws IRISyntaxException;
+  IRI getAlternateLinkResolvedHref(String type, String hreflang) throws IRISyntaxException, MimeTypeParseException;
   
   Collection getCollection();
   

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Workspace.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Workspace.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Workspace.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/model/Workspace.java Fri Sep 29 14:22:50 2006
@@ -17,9 +17,10 @@
 */
 package org.apache.abdera.model;
 
-import java.net.URISyntaxException;
 import java.util.List;
 
+import org.apache.abdera.util.iri.IRISyntaxException;
+
 /**
  * <p>An Atom Publishing Protocol Introspection Document workspace element.</p>
  * 
@@ -74,6 +75,6 @@
   Collection addCollection(
     String title, 
     String href) 
-      throws URISyntaxException;
+      throws IRISyntaxException;
   
 }

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/parser/Parser.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/parser/Parser.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/parser/Parser.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/parser/Parser.java Fri Sep 29 14:22:50 2006
@@ -19,11 +19,11 @@
 
 import java.io.InputStream;
 import java.io.Reader;
-import java.net.URI;
 import java.net.URISyntaxException;
 
 import org.apache.abdera.model.Document;
 import org.apache.abdera.model.Element;
+import org.apache.abdera.util.iri.IRISyntaxException;
 
 /**
  * The Parser is the interface through which developers parse feed documents. 
@@ -32,55 +32,33 @@
   
   <T extends Element>Document<T> parse(
     InputStream in) 
-      throws ParseException;
-  
-  <T extends Element>Document<T> parse(
-    InputStream in, 
-    URI base) 
-      throws ParseException;
-  
-  <T extends Element>Document<T> parse(
-    InputStream in, 
-    URI base, 
-    ParserOptions options) 
-      throws ParseException;
+      throws ParseException, IRISyntaxException;
   
   <T extends Element>Document<T> parse(
     InputStream in, 
     String base) 
-      throws ParseException, URISyntaxException;
+      throws ParseException, IRISyntaxException;
   
   <T extends Element>Document<T> parse(
     InputStream in, 
     String base, 
     ParserOptions options) 
-      throws ParseException, URISyntaxException;
+      throws ParseException, IRISyntaxException;
 
   <T extends Element>Document<T> parse(
       Reader in) 
-        throws ParseException;
+        throws ParseException, URISyntaxException, IRISyntaxException;
     
   <T extends Element>Document<T> parse(
     Reader in, 
-    URI base) 
-      throws ParseException;
-  
-  <T extends Element>Document<T> parse(
-    Reader in, 
-    URI base, 
-    ParserOptions options) 
-      throws ParseException;
-  
-  <T extends Element>Document<T> parse(
-    Reader in, 
     String base) 
-      throws ParseException, URISyntaxException;
+      throws ParseException, IRISyntaxException, URISyntaxException;
   
   <T extends Element>Document<T> parse(
     Reader in, 
     String base, 
     ParserOptions options) 
-      throws ParseException, URISyntaxException;
+      throws ParseException, IRISyntaxException;
   
   ParserOptions getDefaultParserOptions();
   

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaResult.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaResult.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaResult.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaResult.java Fri Sep 29 14:22:50 2006
@@ -29,6 +29,7 @@
 import org.apache.abdera.Abdera;
 import org.apache.abdera.model.Document;
 import org.apache.abdera.model.Element;
+import org.apache.abdera.util.iri.IRISyntaxException;
 
 /**
  * Provides a simple (and likely somewhat inefficient) implementation of 
@@ -58,7 +59,11 @@
   public <T extends Element>Document<T> getDocument() {
     if (doc == null) {
       if (pipein == null) return null;
-      doc = abdera.getParser().parse(pipein);
+      try {
+        doc = abdera.getParser().parse(pipein);
+      } catch (IRISyntaxException e) {
+        // Not going to happen
+      }
     } 
     return doc;
   }

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractParser.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractParser.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractParser.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractParser.java Fri Sep 29 14:22:50 2006
@@ -19,8 +19,6 @@
 
 import java.io.InputStream;
 import java.io.Reader;
-import java.net.URI;
-import java.net.URISyntaxException;
 
 import org.apache.abdera.Abdera;
 import org.apache.abdera.factory.Factory;
@@ -29,6 +27,7 @@
 import org.apache.abdera.parser.ParseException;
 import org.apache.abdera.parser.Parser;
 import org.apache.abdera.parser.ParserOptions;
+import org.apache.abdera.util.iri.IRISyntaxException;
 
 public abstract class AbstractParser 
   implements Parser {
@@ -53,23 +52,16 @@
   
   public <T extends Element>Document<T> parse(
     InputStream in) 
-      throws ParseException {
-    return parse(in, (URI)null, getDefaultParserOptions());
-  }
-
-  public <T extends Element>Document<T> parse(
-    InputStream in, 
-    URI base) 
-      throws ParseException {
-    return parse(in, base, getDefaultParserOptions());
+      throws ParseException, IRISyntaxException {
+    return parse(in, null, getDefaultParserOptions());
   }
 
   public <T extends Element>Document<T> parse(
     InputStream in, 
     String base) 
       throws ParseException, 
-             URISyntaxException {
-    return parse(in, new URI(base), getDefaultParserOptions());
+             IRISyntaxException {
+    return parse(in, base, getDefaultParserOptions());
   }
   
   public <T extends Element>Document<T> parse(
@@ -77,40 +69,24 @@
     String base, 
     ParserOptions options) 
       throws ParseException, 
-             URISyntaxException {
-    return parse(in, (base != null) ? new URI(base) : null, options);
+             IRISyntaxException {
+    return parse(in, (base != null) ? base : null, options);
   }
   
   public <T extends Element>Document<T> parse(
     Reader in) 
-      throws ParseException {
-    return parse(in, (URI)null, getDefaultParserOptions());
-  }
-
-  public <T extends Element>Document<T> parse(
-    Reader in, 
-    URI base) 
-      throws ParseException {
-    return parse(in, base, getDefaultParserOptions());
+      throws ParseException, IRISyntaxException {
+    return parse(in, null, getDefaultParserOptions());
   }
 
   public <T extends Element>Document<T> parse(
     Reader in, 
     String base) 
       throws ParseException, 
-             URISyntaxException {
-    return parse(in, new URI(base), getDefaultParserOptions());
-  }
-  
-  public <T extends Element>Document<T> parse(
-    Reader in, 
-    String base, 
-    ParserOptions options) 
-      throws ParseException, 
-             URISyntaxException {
-    return parse(in, new URI(base), options);
+             IRISyntaxException {
+    return parse(in, base, getDefaultParserOptions());
   }
-  
+
   public abstract ParserOptions getDefaultParserOptions();
   
 }

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/URIHelper.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/URIHelper.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/URIHelper.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/URIHelper.java Fri Sep 29 14:22:50 2006
@@ -17,10 +17,11 @@
 */
 package org.apache.abdera.util;
 
-import java.net.URI;
-import java.net.URISyntaxException;
 import java.util.regex.Pattern;
 
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
+
 public class URIHelper {
 
   private static final Pattern javascript = 
@@ -30,12 +31,12 @@
     Pattern.compile(
       "\\s*m\\s*a\\s*i\\s*l\\s*t\\s*o\\s*:.*");
   
-  public static boolean isJavascriptUri(URI uri) {
+  public static boolean isJavascriptUri(IRI uri) {
     if (uri == null) return false;
     return javascript.matcher(uri.toString()).matches();
   }
   
-  public static boolean isMailtoUri(URI uri) {
+  public static boolean isMailtoUri(IRI uri) {
     if (uri == null) return false;
     return mailto.matcher(uri.toString()).matches();
   }
@@ -43,32 +44,14 @@
   /**
    * Normalize a URI as specified by RFC4287 Section 4.2.6
    */
-  public static URI normalize(
-    URI uri) 
-      throws URISyntaxException {
+  public static IRI normalize(
+    IRI uri) 
+      throws IRISyntaxException {
     if (uri == null) return null;
-    // the normalization built into the URI class only gets us part of the way
-    uri = uri.normalize();
-    String scheme = uri.getScheme().toLowerCase();
-    String host = 
-      (uri.getHost() != null) ? 
-        uri.getHost().toLowerCase() : "";
-    int port = -1;
-    if ("http".equalsIgnoreCase(scheme) && uri.getPort() != 80) 
-      port = uri.getPort();
-    else if ("https".equalsIgnoreCase(scheme) && uri.getPort() != 443) 
-      port = uri.getPort();
-    uri = new URI(
-      scheme, 
-      uri.getUserInfo(), 
-      host, port, 
-      uri.getPath(), 
-      uri.getQuery(), 
-      uri.getFragment());
-    return uri;
+    return uri.normalize();
   }
   
-  public static String normalize(String uri) throws URISyntaxException {
-    return normalize(new URI(uri)).toString();
+  public static String normalize(String uri) throws IRISyntaxException {
+    return normalize(new IRI(uri)).toASCIIString();
   }
 }

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/iri/AbstractScheme.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/iri/AbstractScheme.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/iri/AbstractScheme.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/iri/AbstractScheme.java Fri Sep 29 14:22:50 2006
@@ -53,4 +53,7 @@
       return false;
   }
 
+  public IRI normalize(IRI iri) {
+    return null;
+  }
 }

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/iri/HttpScheme.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/iri/HttpScheme.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/iri/HttpScheme.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/iri/HttpScheme.java Fri Sep 29 14:22:50 2006
@@ -58,5 +58,33 @@
         equal(iri1.getFragment(),iri2.getFragment());
     
   }
+
+  @Override
+  public IRI normalize(IRI iri) {
+    StringBuffer buf = new StringBuffer();
+    int port = (iri.getPort() == getDefaultPort()) ? -1 : iri.getPort();
+    String host = iri.getHost();
+    if (host != null) host = host.toLowerCase();
+    String ui = iri.getUserInfo();
+    iri.buildAuthority(
+      buf, 
+      ui, 
+      host, 
+      port);
+    String authority = buf.toString();
+    return new IRI(
+        iri._scheme,
+        iri.getScheme(),
+        authority,
+        ui,
+        host,
+        port,
+        IRI.normalize(iri.getPath()),
+        iri.getQuery(),
+        iri.getFragment(),
+        iri.doubleslash
+      );
+  }
+  
   
 }

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/iri/IRI.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/iri/IRI.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/iri/IRI.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/iri/IRI.java Fri Sep 29 14:22:50 2006
@@ -33,7 +33,7 @@
              Cloneable {
 
   private static final long serialVersionUID = -4530530782760282284L;
-  private Scheme _scheme;
+  Scheme _scheme;
   private String scheme;
   private String authority;
   private String userinfo;
@@ -42,7 +42,7 @@
   private String path;
   private String query;
   private String fragment;
-  private boolean doubleslash;
+  boolean doubleslash;
 
   private String a_host;
   private String a_fragment;
@@ -58,7 +58,7 @@
   private String d_query;
   private String d_fragment;
   
-  public IRI(java.net.URL url) throws IRISyntaxException, IOException {
+  public IRI(java.net.URL url) throws IRISyntaxException {
     this(Escaping.encode(
         Escaping.decode(url.toString()), 
         Constants.IUNRESERVED, 
@@ -66,7 +66,7 @@
         Constants.PCTENC));
   }
   
-  public IRI(java.net.URI uri) throws IRISyntaxException, IOException {
+  public IRI(java.net.URI uri) throws IRISyntaxException {
     this(Escaping.encode(
       Escaping.decode(uri.toString()), 
       Constants.IUNRESERVED, 
@@ -75,7 +75,7 @@
       Constants.GENDELIMS));
   }
   
-  public IRI(String iri) throws IRISyntaxException, IOException {
+  public IRI(String iri) throws IRISyntaxException {
     Builder b = new Builder();
     parse(iri, b);
     init(
@@ -301,9 +301,7 @@
   
   public String getSchemeSpecificPart() {
     return buildSchemeSpecificPart(
-      userinfo, 
-      host, 
-      port, 
+      authority, 
       path, 
       query, 
       fragment);
@@ -331,9 +329,7 @@
   
   public String getRawSchemeSpecificPart() {
     return buildSchemeSpecificPart(
-      userinfo, 
-      host, 
-      port, 
+      authority,
       path, 
       query, 
       fragment);
@@ -343,7 +339,7 @@
     return userinfo;
   }
   
-  private void buildAuthority(
+  void buildAuthority(
     StringBuffer buf, 
     String aui, 
     String ah, 
@@ -392,24 +388,20 @@
   
   public String getASCIISchemeSpecificPart() {
     return buildSchemeSpecificPart(
-      getASCIIUserInfo(), 
-      getASCIIHost(), 
-      getPort(), 
+      getASCIIAuthority(), 
       getASCIIPath(), 
       getASCIIQuery(), 
       getASCIIFragment());
   }
   
   private String buildSchemeSpecificPart(
-    String userinfo,
-    String host,
-    int port,
+    String authority,
     String path,
     String query,
     String fragment) {
       StringBuffer buf = new StringBuffer();
       if (doubleslash) buf.append("//");
-      buildAuthority(buf, userinfo, host, port);
+      if (authority != null) buf.append(authority);
       if (path != null && path.length() != 0) {
         buf.append(path);
       }
@@ -526,7 +518,9 @@
       userinfo = b.getUserInfo();
       host = b.getHost();
       port = b.getPort();
-      path = c.isPathAbsolute() ? normalize(c.getPath()) : resolve(b.getPath(),c.getPath());
+      path = c.isPathAbsolute() ? 
+          normalize(c.getPath()) : 
+          resolve(b.getPath(),c.getPath());
     } else {
       authority = c.getAuthority();
       userinfo = c.getUserInfo();
@@ -543,21 +537,25 @@
   
   public static IRI normalize(IRI iri) {
     if (iri.isOpaque() || iri.getPath() == null) return iri;
-    return new IRI(
-      iri._scheme,
-      iri.getScheme(),
-      iri.getAuthority(),
-      iri.getUserInfo(),
-      iri.getHost(),
-      iri.getPort(),
-      normalize(iri.getPath()),
-      iri.getQuery(),
-      iri.getFragment(),
-      iri.doubleslash
-    );
+    IRI normalized = null;
+    if (iri._scheme != null) normalized = iri._scheme.normalize(iri);
+    return (normalized != null) ? 
+      normalized : 
+      new IRI(
+        iri._scheme,
+        iri.getScheme(),
+        iri.getAuthority(),
+        iri.getUserInfo(),
+        iri.getHost(),
+        iri.getPort(),
+        normalize(iri.getPath()),
+        iri.getQuery(),
+        iri.getFragment(),
+        iri.doubleslash
+      );
   }
 
-  private static String normalize(String path) {
+  static String normalize(String path) {
     if (path == null) return "/";
     String[] segments = path.split("/");
     if (segments.length < 2) return path;
@@ -581,13 +579,16 @@
         buf.append(segments[n]);
       }
     }
-    if (path.charAt(path.length()-1) == '/') buf.append('/');
+    if (path.endsWith("/") || path.endsWith("/.")) 
+      buf.append('/');
     return buf.toString();
   }
   
   private static String resolve(String bpath, String cpath) {
     if (bpath == null && cpath == null) return null;
-    if (bpath == null && cpath != null) return cpath;
+    if (bpath == null && cpath != null) {
+      return (!cpath.startsWith("/")) ? "/" + cpath : cpath;
+    }
     if (bpath != null && cpath == null) return bpath;
     StringBuffer buf = new StringBuffer("");
     int n = bpath.lastIndexOf('/');
@@ -600,7 +601,7 @@
     return resolve(this,iri);
   }
   
-  public IRI resolve(String iri) throws IRISyntaxException, IOException {
+  public IRI resolve(String iri) throws IRISyntaxException {
     return resolve(this,IRI.create(iri));
   }
   
@@ -645,14 +646,18 @@
   
   ////////// parse implementation
   
-  private static void parse(String uri, Builder builder) throws IRISyntaxException, IOException {
+  private static void parse(String uri, Builder builder) throws IRISyntaxException {
     SchemeRegistry reg = SchemeRegistry.getInstance();
     builder.chars = uri.toCharArray();
     CodepointIterator ci = CodepointIterator.forCharArray(builder.chars);
-    Parser.parse(ci, builder, reg);
+    try {
+      Parser.parse(ci, builder, reg);
+    } catch (IOException e) {
+      throw new IRISyntaxException(e);
+    }
   }
   
-  public static IRI create(String iri) throws IRISyntaxException, IOException {
+  public static IRI create(String iri) throws IRISyntaxException {
     return new IRI(iri);
   }
   
@@ -735,8 +740,9 @@
       if (ci.peek() == ':')
         builder.scheme(e,ci.position()-e);
       Scheme _scheme = null;
-      if (builder.scheme != null && builder.scheme.length() != 0)
-        _scheme = reg.getScheme(builder.scheme);      
+      if (builder.scheme != null && builder.scheme.length() != 0) {
+        _scheme = reg.getScheme(builder.scheme);
+      } else { ci.position(e); }
       if (_scheme != null) {
         // allow for scheme specific parsing. if the resolved scheme
         // does parse the result, skip the rest, otherwise, do the 
@@ -745,7 +751,6 @@
         if (_scheme.parse(ci, builder)) return;
       }
       // default parsing. works for most common schemes
-      else ci.position(e);
       scan(ci, Constants.COLON,1);
       e = ci.position();
       if (ci.peek() == '/' && 

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/iri/IRISyntaxException.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/iri/IRISyntaxException.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/iri/IRISyntaxException.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/iri/IRISyntaxException.java Fri Sep 29 14:22:50 2006
@@ -17,12 +17,15 @@
 */
 package org.apache.abdera.util.iri;
 
-import java.io.IOException;
-
-public class IRISyntaxException extends IOException {
+public class IRISyntaxException extends Exception {
   private static final long serialVersionUID = 5177739661976965423L;
 
   IRISyntaxException(String message) {
     super(message);
   }
+  
+  IRISyntaxException(Throwable cause) {
+    super(cause);
+  }
+  
 }

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/iri/Scheme.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/iri/Scheme.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/iri/Scheme.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/iri/Scheme.java Fri Sep 29 14:22:50 2006
@@ -29,4 +29,7 @@
   boolean equivalent(IRI iri1, IRI iri2);
   
   boolean parse(CodepointIterator reader, Builder builder);
+  
+  IRI normalize(IRI iri); 
+  
 }

Modified: incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/TestSuite.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/TestSuite.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/TestSuite.java (original)
+++ incubator/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/TestSuite.java Fri Sep 29 14:22:50 2006
@@ -18,6 +18,12 @@
 package org.apache.abdera.test.core;
 
 import org.apache.abdera.test.core.CoreTest;
+import org.apache.abdera.test.iri.TestIDNA;
+import org.apache.abdera.test.iri.TestIRI;
+import org.apache.abdera.test.iri.TestLang;
+import org.apache.abdera.test.iri.TestNFKC;
+import org.apache.abdera.test.iri.TestNameprep;
+import org.apache.abdera.test.iri.TestPunycode;
 
 public class TestSuite extends junit.framework.TestSuite {
   public static void main(String[] args) {
@@ -26,5 +32,11 @@
 
   public TestSuite() {
     addTestSuite(CoreTest.class);
+    addTestSuite(TestIDNA.class);
+    addTestSuite(TestIRI.class);
+    addTestSuite(TestLang.class);
+    addTestSuite(TestNameprep.class);
+    addTestSuite(TestNFKC.class);
+    addTestSuite(TestPunycode.class);
   }
 }

Modified: incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appclient/Main.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appclient/Main.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appclient/Main.java (original)
+++ incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appclient/Main.java Fri Sep 29 14:22:50 2006
@@ -17,7 +17,6 @@
 */
 package org.apache.abdera.examples.appclient;
 
-import java.net.URI;
 import java.util.Date;
 import java.util.List;
 
@@ -30,6 +29,7 @@
 import org.apache.abdera.model.Service;
 import org.apache.abdera.protocol.client.Client;
 import org.apache.abdera.protocol.client.CommonsClient;
+import org.apache.abdera.util.iri.IRI;
 
 
 public class Main {
@@ -70,12 +70,12 @@
     // In some implementations (such as Google's GData API, the entry URI is 
     // distinct from it's edit URI.  To be safe, we should assume it may be 
     // different
-    URI entryUri = doc.getBaseUri();
+    IRI entryUri = doc.getBaseUri();
     report("The Created Entry", doc.getRoot().toString());
     
     // Grab the Edit URI from the entry.  The entry MAY have more than one 
     // edit link.  We need to make sure we grab the right one.
-    URI editUri = getEditUri(doc.getRoot());
+    IRI editUri = getEditUri(doc.getRoot());
     
     // If there is an Edit Link, we can edit the entry
     if (editUri != null) {
@@ -108,8 +108,8 @@
     }
   }
 
-  private static URI getEditUri(Entry entry) throws Exception {
-    URI editUri = null;
+  private static IRI getEditUri(Entry entry) throws Exception {
+    IRI editUri = null;
     List<Link> editLinks = entry.getLinks("edit");
     for (Link link : editLinks) {
       // if there is more than one edit link, we should not automatically

Modified: incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appserver/SimpleProvider.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appserver/SimpleProvider.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appserver/SimpleProvider.java (original)
+++ incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appserver/SimpleProvider.java Fri Sep 29 14:22:50 2006
@@ -17,7 +17,6 @@
 */
 package org.apache.abdera.examples.appserver;
 
-import java.net.URI;
 import java.security.MessageDigest;
 import java.util.Date;
 
@@ -45,6 +44,7 @@
 import org.apache.abdera.protocol.server.provider.ResponseContext;
 import org.apache.abdera.protocol.server.provider.TargetType;
 import org.apache.abdera.util.MimeTypeHelper;
+import org.apache.abdera.util.iri.IRI;
 import org.apache.axiom.om.util.Base64;
 
 public class SimpleProvider 
@@ -154,7 +154,7 @@
           feed.insertEntry(entry);
           feed.setUpdated(new Date());
           BaseResponseContext rc = new BaseResponseContext(entry);
-          URI baseUri = resolveBase(request);
+          IRI baseUri = resolveBase(request);
           rc.setLocation(baseUri.resolve(entry.getEditLinkResolvedHref()).toString());
           rc.setContentLocation(rc.getLocation().toString());
           rc.setEntityTag(calculateEntityTag(entry));
@@ -172,7 +172,7 @@
       }
   }
   
-  private URI resolveBase(RequestContext request) {
+  private IRI resolveBase(RequestContext request) {
     return request.getBaseUri().resolve(request.getUri());
   }
   

Modified: incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/simple/Create.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/simple/Create.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/simple/Create.java (original)
+++ incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/simple/Create.java Fri Sep 29 14:22:50 2006
@@ -17,7 +17,6 @@
 */
 package org.apache.abdera.examples.simple;
 
-import java.net.URI;
 import java.util.Date;
 
 import org.apache.abdera.Abdera;
@@ -25,6 +24,7 @@
 import org.apache.abdera.model.Entry;
 import org.apache.abdera.model.Feed;
 import org.apache.abdera.model.Text;
+import org.apache.abdera.util.iri.IRI;
 
 
 public class Create {
@@ -73,7 +73,7 @@
     entry4.setId("urn:uuid:1225c695-cfb8-4ebb-aaaa-cafebabecafe");
     entry4.setUpdated(new Date());
     entry4.setSummary("An entry with out-of-line content");
-    entry4.setContent(new URI("http://example.org/0xcafebabe"), "text/html");
+    entry4.setContent(new IRI("http://example.org/0xcafebabe"), "text/html");
     feed.getDocument().writeTo(System.out);
   }
 

Modified: incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/simple/TextFilterExample.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/simple/TextFilterExample.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/simple/TextFilterExample.java (original)
+++ incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/simple/TextFilterExample.java Fri Sep 29 14:22:50 2006
@@ -63,7 +63,7 @@
     // Parse!
     URL url = TextFilterExample.class.getResource("/simple.xml");
     InputStream in = url.openStream();
-    Document<Feed> doc = parser.parse(in, url.toURI(), options);
+    Document<Feed> doc = parser.parse(in, url.toString(), options);
     Feed feed = doc.getRoot();
     System.out.println(feed.getAuthor().getName());          // Jane Doe
     System.out.println(feed.getEntries().get(0).getTitle()); // Atom-Powered Robots Run Crazy

Modified: incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/simple/UnacceptableElementsExample.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/simple/UnacceptableElementsExample.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/simple/UnacceptableElementsExample.java (original)
+++ incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/simple/UnacceptableElementsExample.java Fri Sep 29 14:22:50 2006
@@ -17,8 +17,6 @@
 */
 package org.apache.abdera.examples.simple;
 
-import java.net.URI;
-
 import javax.xml.namespace.QName;
 
 import org.apache.abdera.Abdera;
@@ -61,7 +59,7 @@
     options.setParseFilter(exceptionFilter);
     Document<Feed> doc = parser.parse(
       UnacceptableElementsExample.class.getResourceAsStream("/xmlcontent.xml"), 
-      (URI)null, options);
+      null, options);
     
     // this will throw a FOMException
     doc.writeTo(System.out);

Modified: incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/json/JSONWriter.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/json/JSONWriter.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/json/JSONWriter.java (original)
+++ incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/json/JSONWriter.java Fri Sep 29 14:22:50 2006
@@ -20,7 +20,6 @@
 
 import java.io.IOException;
 import java.io.OutputStream;
-import java.net.URISyntaxException;
 import java.util.List;
 
 import javax.activation.MimeTypeParseException;
@@ -39,6 +38,7 @@
 import org.apache.abdera.model.Workspace;
 import org.apache.abdera.model.Content.Type;
 import org.apache.abdera.util.AbstractNamedWriter;
+import org.apache.abdera.util.iri.IRISyntaxException;
 import org.apache.abdera.writer.NamedWriter;
 import org.json.JSONArray;
 import org.json.JSONException;
@@ -232,7 +232,7 @@
     return jssvc;
   }
 
-  private static JSONArray categoriesToJSON(List<Category> categories) throws URISyntaxException, JSONException {
+  private static JSONArray categoriesToJSON(List<Category> categories) throws IRISyntaxException, JSONException {
     JSONArray jscategories = new JSONArray();
     for (Category category : categories) {
       if (category.getScheme() != null || category.getLabel() != null || category.getTerm() != null) {
@@ -251,7 +251,7 @@
     return jscategories;
   }
 
-  private static JSONArray personsToJSON(List<Person> persons) throws URISyntaxException, JSONException {
+  private static JSONArray personsToJSON(List<Person> persons) throws IRISyntaxException, JSONException {
     JSONArray jspersons = new JSONArray();
     for (Person p : persons) {
       if (p.getName() != null || p.getUri() != null || p.getEmail() != null) {
@@ -268,7 +268,7 @@
     return jspersons;
   }
 
-  private static JSONArray linksToJSON(List<Link> links) throws URISyntaxException, MimeTypeParseException, JSONException {
+  private static JSONArray linksToJSON(List<Link> links) throws IRISyntaxException, MimeTypeParseException, JSONException {
     JSONArray jslinks = new JSONArray();
     for (Link link : links) {
       JSONObject jslink = new JSONObject();

Modified: incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/thread/InReplyTo.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/thread/InReplyTo.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/thread/InReplyTo.java (original)
+++ incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/thread/InReplyTo.java Fri Sep 29 14:22:50 2006
@@ -17,13 +17,12 @@
 */
 package org.apache.abdera.ext.thread;
 
-import java.net.URI;
-import java.net.URISyntaxException;
-
 import javax.activation.MimeType;
 import javax.activation.MimeTypeParseException;
 
 import org.apache.abdera.model.Element;
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
 
 /**
  * Provides an interface for the Atom Threading Extension in-reply-to
@@ -37,42 +36,42 @@
    * Returns the persistent and universally unique identifier of the 
    * resource the entry is a response to.
    */
-  URI getRef() throws URISyntaxException;
+  IRI getRef() throws IRISyntaxException;
   
   /**
    * Sets the persistent and universally unique identifier of the 
    * resource that this entry is a response to
    */
-  void setRef(URI ref);
+  void setRef(IRI ref);
 
   /**
    * Sets the persistent and universally unique identifier of the 
    * resource that this entry is a response to
    */
-  void setRef(String ref) throws URISyntaxException;
+  void setRef(String ref) throws IRISyntaxException;
   
   /**
    * Returns the resolved value of the href attribute
    */
-  URI getResolvedHref() throws URISyntaxException;
+  IRI getResolvedHref() throws IRISyntaxException;
   
   /**
    * Returns a dereferenceable URI indicating where a representation of the 
    * resource being responded to may be retrieved
    */
-  URI getHref() throws URISyntaxException;
+  IRI getHref() throws IRISyntaxException;
   
   /**
    * Sets a dereferenceable URI indicating where a representation of the 
    * resource being responded to may be retrieved
    */
-  void setHref(URI ref);
+  void setHref(IRI ref);
   
   /**
    * Sets a dereferenceable URI indicating where a representation of the 
    * resource being responded to may be retrieved
    */
-  void setHref(String ref) throws URISyntaxException;
+  void setHref(String ref) throws IRISyntaxException;
   
   /**
    * Returns the media type of the resource referenced by the href attribute
@@ -93,21 +92,21 @@
    * Returns a dereferenceable URI of an Atom Feed or Entry Document resolved
    * against the in-scope Base URI
    */
-  URI getResolvedSource() throws URISyntaxException;
+  IRI getResolvedSource() throws IRISyntaxException;
   
   /**
    * Returns a dereferenceable URI of an Atom Feed or Entry Document
    */
-  URI getSource() throws URISyntaxException;
+  IRI getSource() throws IRISyntaxException;
   
   /**
    * Sets a dereferenceable URI of an Atom Feed or Entry Document
    */
-  void setSource(URI source);
+  void setSource(IRI source);
   
   /**
    * Sets a dereferenceable URI of an Atom Feed or Entry Document
    */
-  void setSource(String source) throws URISyntaxException;
+  void setSource(String source) throws IRISyntaxException;
   
 }

Modified: incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/thread/ThreadHelper.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/thread/ThreadHelper.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/thread/ThreadHelper.java (original)
+++ incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/thread/ThreadHelper.java Fri Sep 29 14:22:50 2006
@@ -17,8 +17,6 @@
 */
 package org.apache.abdera.ext.thread;
 
-import java.net.URI;
-import java.net.URISyntaxException;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
@@ -33,6 +31,8 @@
 import org.apache.abdera.model.Entry;
 import org.apache.abdera.model.Link;
 import org.apache.abdera.model.Source;
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
 
 public final class ThreadHelper {
 
@@ -138,7 +138,7 @@
     return irt;
   }
 
-  public static InReplyTo addInReplyTo(Entry entry, URI ref) {
+  public static InReplyTo addInReplyTo(Entry entry, IRI ref) {
     try {
       if (entry.getId() != null && entry.getId().equals(ref)) return null;
     } catch (Exception e) {}
@@ -147,15 +147,15 @@
     return irt;
   }
 
-  public static InReplyTo addInReplyTo(Entry entry, String ref) throws URISyntaxException {
-    return addInReplyTo(entry, new URI(ref));
+  public static InReplyTo addInReplyTo(Entry entry, String ref) throws IRISyntaxException {
+    return addInReplyTo(entry, new IRI(ref));
   }
 
   public static InReplyTo addInReplyTo(
     Entry entry,
-    URI ref, 
-    URI source, 
-    URI href, 
+    IRI ref, 
+    IRI source, 
+    IRI href, 
     MimeType type) {
       InReplyTo irt = addInReplyTo(entry, ref);
       if (irt != null) {
@@ -172,7 +172,7 @@
     String source, 
     String href, 
     String type) 
-      throws URISyntaxException, 
+      throws IRISyntaxException, 
              MimeTypeParseException {
     InReplyTo irt = addInReplyTo(entry, ref);
     if (irt != null) {

Modified: incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/thread/impl/FOMInReplyTo.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/thread/impl/FOMInReplyTo.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/thread/impl/FOMInReplyTo.java (original)
+++ incubator/abdera/java/trunk/extensions/src/main/java/org/apache/abdera/ext/thread/impl/FOMInReplyTo.java Fri Sep 29 14:22:50 2006
@@ -17,9 +17,6 @@
 */
 package org.apache.abdera.ext.thread.impl;
 
-import java.net.URI;
-import java.net.URISyntaxException;
-
 import javax.activation.MimeType;
 import javax.activation.MimeTypeParseException;
 import javax.xml.namespace.QName;
@@ -27,6 +24,8 @@
 import org.apache.abdera.ext.thread.InReplyTo;
 import org.apache.abdera.ext.thread.ThreadConstants;
 import org.apache.abdera.parser.stax.FOMElement;
+import org.apache.abdera.util.iri.IRI;
+import org.apache.abdera.util.iri.IRISyntaxException;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMFactory;
@@ -44,12 +43,12 @@
     super(ThreadConstants.IN_REPLY_TO);
   }
   
-  public FOMInReplyTo(URI ref) {
+  public FOMInReplyTo(IRI ref) {
     this();
     setRef(ref);
   }
   
-  public FOMInReplyTo(String ref) throws URISyntaxException {
+  public FOMInReplyTo(String ref) throws IRISyntaxException {
     this();
     setRef(ref);
   }
@@ -86,32 +85,32 @@
     super(qname, parent, factory, builder);
   }
 
-  public URI getRef() throws URISyntaxException {
+  public IRI getRef() throws IRISyntaxException {
     return _getUriValue(getAttributeValue(ThreadConstants.THRREF));
   }
 
-  public void setRef(URI ref) {
+  public void setRef(IRI ref) {
     this.setAttributeValue(ThreadConstants.THRREF, ref.toString());
   }
   
-  public void setRef(String ref) throws URISyntaxException {
-    setRef(new URI(ref));
+  public void setRef(String ref) throws IRISyntaxException {
+    setRef(new IRI(ref));
   }
 
-  public URI getResolvedHref() throws URISyntaxException {
+  public IRI getResolvedHref() throws IRISyntaxException {
     return _resolve(getResolvedBaseUri(), getHref());
   }
   
-  public URI getHref() throws URISyntaxException {
+  public IRI getHref() throws IRISyntaxException {
     return _getUriValue(getAttributeValue(HREF));
   }
 
-  public void setHref(URI ref) {
+  public void setHref(IRI ref) {
     this.setAttributeValue(HREF, ref.toString());
   }
 
-  public void setHref(String ref) throws URISyntaxException {
-    setHref(new URI(ref));
+  public void setHref(String ref) throws IRISyntaxException {
+    setHref(new IRI(ref));
   }
   
   public MimeType getMimeType() throws MimeTypeParseException {
@@ -131,20 +130,20 @@
     setMimeType(new MimeType(mimeType));
   }
   
-  public URI getResolvedSource() throws URISyntaxException {
+  public IRI getResolvedSource() throws IRISyntaxException {
     return _resolve(getResolvedBaseUri(), getSource());
   }
   
-  public URI getSource() throws URISyntaxException {
+  public IRI getSource() throws IRISyntaxException {
     return _getUriValue(getAttributeValue(ThreadConstants.THRSOURCE));
   }
 
-  public void setSource(URI source) {
+  public void setSource(IRI source) {
     this.setAttributeValue(ThreadConstants.THRSOURCE, source.toString());
   }
   
-  public void setSource(String source) throws URISyntaxException {
-    setSource(new URI(source));
+  public void setSource(String source) throws IRISyntaxException {
+    setSource(new IRI(source));
   }
 
 }

Modified: incubator/abdera/java/trunk/extensions/src/test/java/org/apache/abdera/test/ext/opensearch/OpenSearchTest.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/extensions/src/test/java/org/apache/abdera/test/ext/opensearch/OpenSearchTest.java?view=diff&rev=451450&r1=451449&r2=451450
==============================================================================
--- incubator/abdera/java/trunk/extensions/src/test/java/org/apache/abdera/test/ext/opensearch/OpenSearchTest.java (original)
+++ incubator/abdera/java/trunk/extensions/src/test/java/org/apache/abdera/test/ext/opensearch/OpenSearchTest.java Fri Sep 29 14:22:50 2006
@@ -33,7 +33,7 @@
 import java.io.InputStream;
 
 public class OpenSearchTest extends TestCase {
-  public void testBasics()
+  public void testBasics() throws Exception
   {
     Parser parser = Abdera.getNewParser();
     



Mime
View raw message