Skip to content

Commit

Permalink
GEODE-9523: Fix invalid path in ContainerInstall (apache#6774)
Browse files Browse the repository at this point in the history
PROBLEM

`ContainerInstall` fetches a resource URL, then applies a chain of
conversions before passing the resulting URL to the `ZipURLInstaller`
constructor.  One of the conversions attempts to create a `Path` from a
string.  On Windows, the string value is not a valid path, and
`Paths.get(...)` throws an exception.

SOLUTION

Change `ContainerInstall` to remove all of the conversions. The original
resource URL is acceptable to `ZipURLInstaller` without any conversion.
  • Loading branch information
demery-pivotal authored Aug 20, 2021
1 parent 9fcbb74 commit 2752849
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.io.IOException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Properties;
import java.util.function.IntSupplier;
Expand Down Expand Up @@ -144,8 +143,7 @@ public ContainerInstall(String name, String downloadURL, ConnectionType connType

clearPreviousInstall(installDir);

String resource = getResource(getClass(), "/" + downloadURL).getPath();
URL url = Paths.get(resource).toUri().toURL();
URL url = getResource(getClass(), "/" + downloadURL);
logger.info("Installing container from URL " + url);

// Optional step to install the container from a URL pointing to its distribution
Expand Down

0 comments on commit 2752849

Please sign in to comment.