You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by gr...@apache.org on 2005/05/09 02:02:41 UTC

svn commit: r169195 - in /lenya/trunk/src/java/org/apache/lenya: ac/file/FileAccreditableManager.java ac/file/FilePolicyManager.java lucene/index/ConfigurableIndexer.java

Author: gregor
Date: Sun May  8 17:02:40 2005
New Revision: 169195

URL: http://svn.apache.org/viewcvs?rev=169195&view=rev
Log:
Made sure that URI strings are properly encoded when calling the URI default constructor. This resolves the long-standing issue http://issues.apache.org/bugzilla/show_bug.cgi?id=27558 where Lenya could not be installed in a directory with spaces in the path.

Modified:
    lenya/trunk/src/java/org/apache/lenya/ac/file/FileAccreditableManager.java
    lenya/trunk/src/java/org/apache/lenya/ac/file/FilePolicyManager.java
    lenya/trunk/src/java/org/apache/lenya/lucene/index/ConfigurableIndexer.java

Modified: lenya/trunk/src/java/org/apache/lenya/ac/file/FileAccreditableManager.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/ac/file/FileAccreditableManager.java?rev=169195&r1=169194&r2=169195&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/ac/file/FileAccreditableManager.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/ac/file/FileAccreditableManager.java Sun May  8 17:02:40 2005
@@ -34,6 +34,7 @@
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.service.Serviceable;
+import org.apache.cocoon.util.NetUtils;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceResolver;
 import org.apache.lenya.ac.AccessControlException;
@@ -111,7 +112,7 @@
                 source = resolver.resolveURI(this.configurationDirectoryPath);
 
                 getLogger().debug("Configuration directory URI: " + source.getURI());
-                directory = new File(new URI(source.getURI()));
+                directory = new File(new URI(NetUtils.encodePath(source.getURI())));
             } catch (Exception e) {
                 throw new AccessControlException(e);
             } finally {

Modified: lenya/trunk/src/java/org/apache/lenya/ac/file/FilePolicyManager.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/ac/file/FilePolicyManager.java?rev=169195&r1=169194&r2=169195&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/ac/file/FilePolicyManager.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/ac/file/FilePolicyManager.java Sun May  8 17:02:40 2005
@@ -36,6 +36,7 @@
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.service.Serviceable;
+import org.apache.cocoon.util.NetUtils;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceResolver;
 import org.apache.lenya.ac.AccessControlException;
@@ -207,8 +208,8 @@
         String fileUri = getPolicySourceURI(url, policyFilename);
         File file;
         try {
-            file = new File(new URI(fileUri));
-        } catch (Exception e) {
+            file = new File(new URI(NetUtils.encodePath(fileUri)));
+        } catch (final Exception e) {
             throw new AccessControlException(e);
         }
         return file;
@@ -317,8 +318,8 @@
                 resolver = (SourceResolver) getServiceManager().lookup(SourceResolver.ROLE);
                 source = resolver.resolveURI(this.policiesDirectoryUri);
                 getLogger().debug("Policies directory source: [" + source.getURI() + "]");
-                directory = new File(new URI(source.getURI()));
-            } catch (Exception e) {
+                directory = new File(new URI(NetUtils.encodePath(source.getURI())));
+            } catch (final Exception e) {
                 throw new AccessControlException("Resolving policies directory failed: ", e);
             } finally {
                 if (resolver != null) {

Modified: lenya/trunk/src/java/org/apache/lenya/lucene/index/ConfigurableIndexer.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/lucene/index/ConfigurableIndexer.java?rev=169195&r1=169194&r2=169195&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/lucene/index/ConfigurableIndexer.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/lucene/index/ConfigurableIndexer.java Sun May  8 17:02:40 2005
@@ -38,6 +38,7 @@
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.transform.stream.StreamSource;
 
+import org.apache.cocoon.util.NetUtils;
 import org.apache.lenya.xml.DocumentHelper;
 import org.apache.log4j.Logger;
 import org.w3c.dom.Document;
@@ -86,7 +87,7 @@
             _log.debug(".getStylesheet(): Configuration file: " + configurationFile.getAbsolutePath());
 
             URL configurationCreatorURL = ConfigurableIndexer.class.getClassLoader().getResource(CONFIGURATION_CREATOR_STYLESHEET);
-            File configurationStylesheetFile = new File(new URI(configurationCreatorURL.toString()));
+            File configurationStylesheetFile = new File(new URI(NetUtils.encodePath(configurationCreatorURL.toString())));
             Document configurationDocument = DocumentHelper.readDocument(configurationFile);
 
             TransformerFactory tFactory = TransformerFactory.newInstance();



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org