You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:43:23 UTC
[sling-org-apache-sling-installer-factory-configuration] 06/08:
SLING-3463 - Config files cannot be installed via FileProvider on Windows
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag org.apache.sling.installer.factory.configuration-1.0.12
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-installer-factory-configuration.git
commit 10c2ee3c09a232b9b56bc1b5379725a4d1b697db
Author: Chetan Mehrotra <ch...@apache.org>
AuthorDate: Thu Mar 20 04:10:15 2014 +0000
SLING-3463 - Config files cannot be installed via FileProvider on Windows
Preprocessing the path to use forward slash so that later logic works properly
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/installer/factories/configuration@1579534 13f79535-47bb-0310-9956-ffa450edef68
---
.../factories/configuration/impl/ConfigTaskCreator.java | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/sling/installer/factories/configuration/impl/ConfigTaskCreator.java b/src/main/java/org/apache/sling/installer/factories/configuration/impl/ConfigTaskCreator.java
index b14dbd3..b9ee1fa 100644
--- a/src/main/java/org/apache/sling/installer/factories/configuration/impl/ConfigTaskCreator.java
+++ b/src/main/java/org/apache/sling/installer/factories/configuration/impl/ConfigTaskCreator.java
@@ -160,7 +160,7 @@ public class ConfigTaskCreator
* @param resource The resource
*/
private TransformationResult[] checkConfiguration(final RegisteredResource resource) {
- final String url = resource.getURL();
+ final String url = separatorsToUnix(resource.getURL());
String lastIdPart = url;
final int pos = lastIdPart.lastIndexOf('/');
if ( pos != -1 ) {
@@ -238,6 +238,19 @@ public class ConfigTaskCreator
return false;
}
+ /**
+ * Converts all separators to the Unix separator of forward slash.
+ *
+ * @param path the path to be changed, null ignored
+ * @return the updated path
+ */
+ private static String separatorsToUnix(String path) {
+ if (path == null || path.indexOf('\\') == -1) {
+ return path;
+ }
+ return path.replace('\\', '/');
+ }
+
private static final Object LOCK = new Object();
public static Object getLock() {
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.