You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by th...@apache.org on 2019/08/31 16:06:27 UTC

[tapestry-5] branch 5.4.x updated: In resource code, handling backslash as path separator better

This is an automated email from the ASF dual-hosted git repository.

thiagohp pushed a commit to branch 5.4.x
in repository https://gitbox.apache.org/repos/asf/tapestry-5.git


The following commit(s) were added to refs/heads/5.4.x by this push:
     new 6dd7219  In resource code, handling backslash as path separator better
6dd7219 is described below

commit 6dd7219fd4707467a36091e2f7f5f6460c619099
Author: thiagohp <th...@arsmachina>
AuthorDate: Sat Aug 31 15:57:28 2019 -0300

    In resource code, handling backslash as path separator better
---
 .../java/org/apache/tapestry5/ioc/internal/util/AbstractResource.java  | 3 +++
 1 file changed, 3 insertions(+)

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 2ead75e..d47b7a3 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
@@ -101,6 +101,9 @@ public abstract class AbstractResource extends LockSupport implements Resource
             terms.add(term);
         }
 
+        // Handling systems using backslash as the path separator, such as Windows
+        relativePath = relativePath.replace('\\', '/');
+        
         for (String term : relativePath.split("/"))
         {
             // This will occur if the relative path contains sequential slashes