Updated Branches:
  refs/heads/master 2f0612bb5 -> 0d784d945

TAP5-2165: Resource name case check breaks applications on windows


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/0d784d94
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/0d784d94
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/0d784d94

Branch: refs/heads/master
Commit: 0d784d94547cbcb06a53b949c9e293a1922a7aa5
Parents: 2f0612b
Author: Howard M. Lewis Ship <hls...@apache.org>
Authored: Tue Sep 3 16:05:09 2013 -0700
Committer: Howard M. Lewis Ship <hls...@apache.org>
Committed: Tue Sep 3 16:05:18 2013 -0700

----------------------------------------------------------------------
 .../apache/tapestry5/ioc/internal/util/AbstractResource.java    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0d784d94/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/util/AbstractResource.java
----------------------------------------------------------------------
diff --git 
a/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/util/AbstractResource.java
 
b/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/util/AbstractResource.java
index 23773cd..7020cb9 100644
--- 
a/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/util/AbstractResource.java
+++ 
b/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/util/AbstractResource.java
@@ -318,7 +318,10 @@ public abstract class AbstractResource extends LockSupport 
implements Resource
 
         try
         {
-            expectedFileName = extractFile(file.getCanonicalPath());
+            // On Windows, the canonical path uses backslash ('\') for the 
separator; an easy hack
+            // is to convert the platform file separator to match sane 
operating systems (which use a foward slash).
+            String sep = System.getProperty("file.separator");
+            expectedFileName = 
extractFile(file.getCanonicalPath().replace(sep, "/"));
         } catch (IOException e)
         {
             return;

Reply via email to