SLING-7286 JavaEscapeUtils.makeJavaPackage dows not work with windows paths
diff --git a/src/main/java/org/apache/sling/scripting/sightly/java/compiler/JavaEscapeUtils.java b/src/main/java/org/apache/sling/scripting/sightly/java/compiler/JavaEscapeUtils.java
index 08b4669..e22390a 100644
--- a/src/main/java/org/apache/sling/scripting/sightly/java/compiler/JavaEscapeUtils.java
+++ b/src/main/java/org/apache/sling/scripting/sightly/java/compiler/JavaEscapeUtils.java
@@ -135,7 +135,7 @@
      * @return Java package corresponding to the given scriptName
      */
     public static String makeJavaPackage(String scriptName) {
-        String classNameComponents[] = StringUtils.split(scriptName, '/');
+        String classNameComponents[] = StringUtils.split(scriptName, "/\\");
         StringBuilder legalClassNames = new StringBuilder();
         for (int i = 0; i < classNameComponents.length; i++) {
             legalClassNames.append(makeJavaIdentifier(classNameComponents[i]));
diff --git a/src/test/java/org/apache/sling/scripting/sightly/java/compiler/JavaEscapeUtilsTest.java b/src/test/java/org/apache/sling/scripting/sightly/java/compiler/JavaEscapeUtilsTest.java
new file mode 100644
index 0000000..8766b3d
--- /dev/null
+++ b/src/test/java/org/apache/sling/scripting/sightly/java/compiler/JavaEscapeUtilsTest.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.scripting.sightly.java.compiler;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+public class JavaEscapeUtilsTest {
+
+    @Test
+    public void testMakeJavaPackage() {
+        assertEquals("apps.projects.script_html", JavaEscapeUtils.makeJavaPackage("/apps/projects/script.html"));
+        // test also with windows path names
+        assertEquals("apps.projects.script_html", JavaEscapeUtils.makeJavaPackage("\\apps\\projects\\script.html"));
+    }
+
+}