Skip to content

Commit

Permalink
[java] Fixing paths to work on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Nov 13, 2019
1 parent c6a31d8 commit 4c3239d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public static void main(String[] args) throws IOException {
Files.walkFileTree(target, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
String relative = target.relativize(dir).toString();
String relative = target.relativize(dir).toString().replace('\\', '/');
JarEntry entry = new JarEntry(devtoolsDir + relative + "/");
jos.putNextEntry(entry);
jos.closeEntry();
Expand All @@ -94,7 +94,7 @@ public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) th

@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
String relative = target.relativize(file).toString();
String relative = target.relativize(file).toString().replace('\\', '/');
JarEntry entry = new JarEntry(devtoolsDir + relative);
jos.putNextEntry(entry);
try (InputStream is = Files.newInputStream(file)) {
Expand Down

0 comments on commit 4c3239d

Please sign in to comment.