Skip to content

Commit

Permalink
Windows friendly path handling (hopefully)
Browse files Browse the repository at this point in the history
jleyba committed May 2, 2019
1 parent fb2b085 commit 1945ed5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions java/client/src/org/openqa/selenium/tools/DeleteFromZip.java
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
import com.google.common.io.RecursiveDeleteOption;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Files;
@@ -13,7 +14,7 @@
import java.util.Map;

final class DeleteFromZip {
public static void main(String[] args) throws IOException {
public static void main(String[] args) throws IOException, URISyntaxException {
if (args.length < 2) {
throw new RuntimeException("usage: [zip file] [paths to delete...]");
}
@@ -22,7 +23,8 @@ public static void main(String[] args) throws IOException {
properties.put("create", "false");

Path zip = Paths.get(args[0]).toAbsolutePath();
URI uri = URI.create("jar:file:" + zip);
URI uri = new URI("jar", zip.toUri().toString(), null);
// URI uri = URI.create("jar:file:" + zip);
try (FileSystem zipfs = FileSystems.newFileSystem(uri, properties)) {
System.out.println("Opened " + args[0]);
for (int i = 1; i < args.length; i++) {

0 comments on commit 1945ed5

Please sign in to comment.