cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r489923 - in /cocoon/trunk/core/cocoon-xml/cocoon-xml-impl: pom.xml src/main/java/org/apache/cocoon/core/xml/impl/DefaultEntityResolver.java
Date Sat, 23 Dec 2006 19:05:10 GMT
Author: cziegeler
Date: Sat Dec 23 11:05:09 2006
New Revision: 489923

URL: http://svn.apache.org/viewvc?view=rev&rev=489923
Log:
Make impl compilable

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

Modified: cocoon/trunk/core/cocoon-xml/cocoon-xml-impl/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-xml/cocoon-xml-impl/pom.xml?view=diff&rev=489923&r1=489922&r2=489923
==============================================================================
--- cocoon/trunk/core/cocoon-xml/cocoon-xml-impl/pom.xml (original)
+++ cocoon/trunk/core/cocoon-xml/cocoon-xml-impl/pom.xml Sat Dec 23 11:05:09 2006
@@ -44,6 +44,11 @@
       <version>1.0.0-SNAPSHOT</version>
     </dependency>
     <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-core</artifactId>
+      <version>2.0.1</version>
+    </dependency>   
+    <dependency>
       <groupId>xml-apis</groupId>
       <artifactId>xml-apis</artifactId>
       <version>1.3.02</version>

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=489923&r1=489922&r2=489923
==============================================================================
--- 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
Sat Dec 23 11:05:09 2006
@@ -16,9 +16,9 @@
  */
 package org.apache.cocoon.core.xml.impl;
 
+import java.io.File;
 import java.io.IOException;
 
-import org.apache.cocoon.core.container.spring.ResourceUtils;
 import org.apache.cocoon.util.AbstractLogEnabled;
 import org.apache.xml.resolver.CatalogManager;
 import org.apache.xml.resolver.tools.CatalogResolver;
@@ -37,6 +37,8 @@
  * found at
  * http://xml.apache.org/cocoon/userdocs/concepts/catalog.html
  *
+ * TODO - This class contains two methods copied from core's resource utils!!
+ *
  * @version $Id$
  * @since 2.2
  */
@@ -44,6 +46,21 @@
     extends AbstractLogEnabled
     implements EntityResolver {
 
+    /**
+     * TODO - Copied from ResourceUtils
+     */
+    protected static String correctUri(String uri) {
+        // 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 uri;
+    }
+
     /** The catalog manager */
     protected CatalogManager catalogManager = new CatalogManager();
 
@@ -129,7 +146,7 @@
 
         final Resource resource = this.resourceLoader.getResource(uri);
         try {
-            this.catalogResolver.getCatalog().parseCatalog(ResourceUtils.getUri(resource));
+            this.catalogResolver.getCatalog().parseCatalog(correctUri(resource.getURL().toExternalForm()));
         } catch (Exception e) {   
             this.getLogger().warn("Could not get Catalog file. Trying again: " + uri, e);
                         



Mime
View raw message