From 6028d92a4e93f8a6cdd681d51248520970e6e3aa Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Thu, 9 Oct 2014 19:06:28 -0700 Subject: [PATCH] Support Windows UNC paths with fat jars Update `Launcher` and `JarFile` to correctly deal with Windows UNC paths. Fixes gh-1641 --- .../src/main/java/org/springframework/boot/loader/Launcher.java | 2 +- .../main/java/org/springframework/boot/loader/jar/JarFile.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/Launcher.java b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/Launcher.java index 0e73a43e5d..770a086a66 100644 --- a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/Launcher.java +++ b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/Launcher.java @@ -142,7 +142,7 @@ public abstract class Launcher { ProtectionDomain protectionDomain = getClass().getProtectionDomain(); CodeSource codeSource = protectionDomain.getCodeSource(); URI location = (codeSource == null ? null : codeSource.getLocation().toURI()); - String path = (location == null ? null : location.getPath()); + String path = (location == null ? null : location.getSchemeSpecificPart()); if (path == null) { throw new IllegalStateException("Unable to determine code source archive"); } diff --git a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java index 9785800df2..bb838ca995 100644 --- a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java +++ b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFile.java @@ -424,6 +424,7 @@ public class JarFile extends java.util.jar.JarFile implements Iterable