cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r490195 - in /cocoon/trunk/core/cocoon-xml: cocoon-xml-impl/src/main/java/org/apache/cocoon/core/xml/impl/DefaultEntityResolver.java cocoon-xml-resolver/src/main/java/org/apache/cocoon/core/xml/resolver/CocoonSystemResolver.java
Date Mon, 25 Dec 2006 22:42:21 GMT
Author: cziegeler
Date: Mon Dec 25 14:42:20 2006
New Revision: 490195

URL: http://svn.apache.org/viewvc?view=rev&rev=490195
Log:
Make the entity resolver work

Modified:
    cocoon/trunk/core/cocoon-xml/cocoon-xml-impl/src/main/java/org/apache/cocoon/core/xml/impl/DefaultEntityResolver.java
    cocoon/trunk/core/cocoon-xml/cocoon-xml-resolver/src/main/java/org/apache/cocoon/core/xml/resolver/CocoonSystemResolver.java

Modified: cocoon/trunk/core/cocoon-xml/cocoon-xml-impl/src/main/java/org/apache/cocoon/core/xml/impl/DefaultEntityResolver.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-xml/cocoon-xml-impl/src/main/java/org/apache/cocoon/core/xml/impl/DefaultEntityResolver.java?view=diff&rev=490195&r1=490194&r2=490195
==============================================================================
--- cocoon/trunk/core/cocoon-xml/cocoon-xml-impl/src/main/java/org/apache/cocoon/core/xml/impl/DefaultEntityResolver.java
(original)
+++ cocoon/trunk/core/cocoon-xml/cocoon-xml-impl/src/main/java/org/apache/cocoon/core/xml/impl/DefaultEntityResolver.java
Mon Dec 25 14:42:20 2006
@@ -39,8 +39,6 @@
  * found at
  * http://xml.apache.org/cocoon/userdocs/concepts/catalog.html
  *
- * TODO - This class contains one method copied from core's resource utils!!
- *
  * @version $Id$
  * @since 2.2
  */
@@ -59,16 +57,16 @@
     }
 
     /**
-     * TODO - Copied from ResourceUtils
+     * Correct resource uris.
      */
-    protected static String correctUri(String uri) {
+    protected String correctUri(String uri) throws IOException {
         // if it is a file we have to recreate the url,
         // otherwise we get problems under windows with some file
         // references starting with "/DRIVELETTER" and some
         // just with "DRIVELETTER"
         if (uri.startsWith("file:")) {
             final File f = new File(uri.substring(5));
-            return "file://" + f.getAbsolutePath();
+            return f.toURL().toExternalForm();
         }
         return uri;
     }
@@ -158,7 +156,7 @@
 
         final Resource resource = this.resourceLoader.getResource(uri);
         try {
-            this.catalogResolver.getCatalog().parseCatalog(correctUri(resource.getURL().toExternalForm()));
+            this.catalogResolver.getCatalog().parseCatalog(this.correctUri(resource.getURL().toExternalForm()));
         } catch (Exception e) {   
             this.getLogger().warn("Could not get Catalog file. Trying again: " + uri, e);
                         

Modified: cocoon/trunk/core/cocoon-xml/cocoon-xml-resolver/src/main/java/org/apache/cocoon/core/xml/resolver/CocoonSystemResolver.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-xml/cocoon-xml-resolver/src/main/java/org/apache/cocoon/core/xml/resolver/CocoonSystemResolver.java?view=diff&rev=490195&r1=490194&r2=490195
==============================================================================
--- cocoon/trunk/core/cocoon-xml/cocoon-xml-resolver/src/main/java/org/apache/cocoon/core/xml/resolver/CocoonSystemResolver.java
(original)
+++ cocoon/trunk/core/cocoon-xml/cocoon-xml-resolver/src/main/java/org/apache/cocoon/core/xml/resolver/CocoonSystemResolver.java
Mon Dec 25 14:42:20 2006
@@ -48,7 +48,7 @@
         // deploy resources
         DeploymentUtil.deployJarResources("META-INF/cocoon/entities", entitiesDirectory.getAbsolutePath());
         // set catalog
-        this.setCatalog(entitiesDirectory.getAbsolutePath() + File.separator + "catalog");
+        this.setCatalog(entitiesDirectory.toURL().toExternalForm() + "/catalog");
         // now initialize
         super.init();
     }



Mime
View raw message