Commit 28f7cf44 authored by Andy Wilkinson's avatar Andy Wilkinson

Convert URL to File using a URI so that URL-encoding is removed

Fixes #1429
parent 95d65c2f
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
package org.springframework.boot.gradle.agent; package org.springframework.boot.gradle.agent;
import java.io.File; import java.io.File;
import java.net.URISyntaxException;
import java.security.CodeSource; import java.security.CodeSource;
import org.gradle.api.Action; import org.gradle.api.Action;
...@@ -84,7 +85,14 @@ public class AgentTasksEnhancer implements Action<Project> { ...@@ -84,7 +85,14 @@ public class AgentTasksEnhancer implements Action<Project> {
if (loaded != null) { if (loaded != null) {
CodeSource source = loaded.getProtectionDomain().getCodeSource(); CodeSource source = loaded.getProtectionDomain().getCodeSource();
if (source != null) { if (source != null) {
return new File(source.getLocation().getFile()); File agent;
try {
agent = new File(source.getLocation().toURI());
}
catch (URISyntaxException ex) {
agent = new File(source.getLocation().getPath());
}
return agent;
} }
} }
} }
......
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