From c8c99d2292a525d6a0ea0b5ad45d6e794fd27db7 Mon Sep 17 00:00:00 2001
From: Robert Scott <code@humanleg.org.uk>
Date: Tue, 21 Aug 2018 23:20:29 +0100
Subject: [PATCH v1 2/2] PluginServer: ensure jar relative path is stringified
 with forward-slashes even on windows

as we're going to be joining it into a url
---
 test/unit/org/openstreetmap/josm/testutils/PluginServer.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/test/unit/org/openstreetmap/josm/testutils/PluginServer.java b/test/unit/org/openstreetmap/josm/testutils/PluginServer.java
index 79543e4f5..a8aceb2ca 100644
--- a/test/unit/org/openstreetmap/josm/testutils/PluginServer.java
+++ b/test/unit/org/openstreetmap/josm/testutils/PluginServer.java
@@ -25,6 +25,7 @@ import com.github.tomakehurst.wiremock.client.WireMock;
 import com.github.tomakehurst.wiremock.core.Options;
 import com.github.tomakehurst.wiremock.junit.WireMockRule;
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Streams;
 
 public class PluginServer {
     public static class RemotePlugin {
@@ -117,7 +118,8 @@ public class PluginServer {
                 final Path filesRootPath = new File(TestUtils.getTestDataRoot()).toPath().toAbsolutePath().resolve("__files").normalize();
 
                 if (jarPath.startsWith(filesRootPath)) {
-                    return filesRootPath.relativize(jarPath).toString();
+                    // would just use .toString() but need to force use of *forward slash* path separators on all platforms
+                    return Streams.stream(filesRootPath.relativize(jarPath)).map(p -> p.toString()).collect(Collectors.joining("/"));
                 }
             }
             return null;
-- 
2.11.0

