Commit 2d43781c authored by Daniel L. Buchko's avatar Daniel L. Buchko Committed by Phillip Webb

Fixed handling of spaces in file paths

Update Launcher to correctly handle spaced in file paths.
parent 8b4a87d2
......@@ -18,6 +18,7 @@ package org.springframework.boot.loader;
import java.io.File;
import java.lang.reflect.Constructor;
import java.net.URI;
import java.net.URL;
import java.security.CodeSource;
import java.security.ProtectionDomain;
......@@ -67,13 +68,12 @@ public abstract class Launcher {
protected void launch(String[] args, ProtectionDomain protectionDomain)
throws Exception {
CodeSource codeSource = protectionDomain.getCodeSource();
URL codeSourceLocation = (codeSource == null ? null : codeSource.getLocation());
String codeSourcePath = (codeSourceLocation == null ? null : codeSourceLocation
.getPath());
if (codeSourcePath == null) {
URI location = (codeSource == null ? null : codeSource.getLocation().toURI());
String path = (location == null ? null : location.getPath());
if (path == null) {
throw new IllegalStateException("Unable to determine code source archive");
}
File root = new File(codeSourcePath);
File root = new File(path);
if (!root.exists()) {
throw new IllegalStateException(
"Unable to determine code source archive from " + root);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment