You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by no...@apache.org on 2010/01/04 15:51:20 UTC

svn commit: r895648 - /james/server/sandbox/active/pure_spring_deployment/spring-deployment/src/main/java/org/apache/james/container/spring/JamesServerApplicationContext.java

Author: norman
Date: Mon Jan  4 14:51:20 2010
New Revision: 895648

URL: http://svn.apache.org/viewvc?rev=895648&view=rev
Log:
Correctly handle ABSOLUTE file:/// configurations and file:// configurations

Modified:
    james/server/sandbox/active/pure_spring_deployment/spring-deployment/src/main/java/org/apache/james/container/spring/JamesServerApplicationContext.java

Modified: james/server/sandbox/active/pure_spring_deployment/spring-deployment/src/main/java/org/apache/james/container/spring/JamesServerApplicationContext.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/active/pure_spring_deployment/spring-deployment/src/main/java/org/apache/james/container/spring/JamesServerApplicationContext.java?rev=895648&r1=895647&r2=895648&view=diff
==============================================================================
--- james/server/sandbox/active/pure_spring_deployment/spring-deployment/src/main/java/org/apache/james/container/spring/JamesServerApplicationContext.java (original)
+++ james/server/sandbox/active/pure_spring_deployment/spring-deployment/src/main/java/org/apache/james/container/spring/JamesServerApplicationContext.java Mon Jan  4 14:51:20 2010
@@ -28,6 +28,8 @@
 public class JamesServerApplicationContext extends ClassPathXmlApplicationContext{
 
     private static final String FILE_PROTOCOL = "file://";
+    private static final String FILE_PROTOCOL_ABSOLUTE = "file:///";
+
     private static final String FILE_PROTOCOL_AND_CONF = "file://conf/";
     private static final String FILE_PROTOCOL_AND_VAR = "file://var/";
     
@@ -46,8 +48,11 @@
                 file = new File("../conf/" + fileURL.substring(FILE_PROTOCOL_AND_CONF.length()));
             } else if (fileURL.startsWith(FILE_PROTOCOL_AND_VAR)) {
                 file = new File("../var/" + fileURL.substring(FILE_PROTOCOL_AND_VAR.length()));
+            } else if (fileURL.startsWith(FILE_PROTOCOL_ABSOLUTE)) {
+            	file = new File("/" + fileURL.substring(FILE_PROTOCOL.length()));
             } else {
-                file = new File("./" + fileURL.substring(FILE_PROTOCOL.length()));
+            	// move to the root folder of the spring deployment
+                file = new File("../" + fileURL.substring(FILE_PROTOCOL.length()));
             }
             r = new FileSystemResource(file);
         } else {



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org