FELIX-4719 - Fixed directory separator:

- The ZIP specification mandates that *only* forward slashes
  to be used for separating directories. See section 4.4.17.1
  of <https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT>.



git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1651784 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/spi/SnapshotCommand.java b/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/spi/SnapshotCommand.java
index a233d55..29c2c2c 100644
--- a/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/spi/SnapshotCommand.java
+++ b/deploymentadmin/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/spi/SnapshotCommand.java
@@ -38,6 +38,9 @@
 import org.osgi.service.log.LogService;
 
 public class SnapshotCommand extends Command {
+    /** The ZIP specification mandates that directory-entries end with a forward slash (on all platforms). */
+    static final String FORWARD_SLASH = "/";
+
     private final GetStorageAreaCommand m_getStorageAreaCommand;
 
     public SnapshotCommand(GetStorageAreaCommand getStorageAreaCommand) {
@@ -162,7 +165,11 @@
         else if (entry.isDirectory()) {
             String baseDir = "";
             if (!"".equals(entryName)) {
-                baseDir = entryName.concat(File.separator);
+                baseDir = entryName;
+                // Directories *must* use forward slashes...
+                if (!baseDir.endsWith(FORWARD_SLASH)) {
+                    baseDir = baseDir.concat(FORWARD_SLASH);
+                }
 
                 output.putNextEntry(new ZipEntry(baseDir));
                 output.closeEntry();