Skip to content

Commit 28f7cf4

Browse files
committed
Convert URL to File using a URI so that URL-encoding is removed
Fixes #1429
1 parent 95d65c2 commit 28f7cf4

File tree

1 file changed

+9
-1
lines changed
  • spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/agent

1 file changed

+9
-1
lines changed

spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/agent/AgentTasksEnhancer.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package org.springframework.boot.gradle.agent;
1818

1919
import java.io.File;
20+
import java.net.URISyntaxException;
2021
import java.security.CodeSource;
2122

2223
import org.gradle.api.Action;
@@ -84,7 +85,14 @@ private File getSpringLoadedAgent() {
8485
if (loaded != null) {
8586
CodeSource source = loaded.getProtectionDomain().getCodeSource();
8687
if (source != null) {
87-
return new File(source.getLocation().getFile());
88+
File agent;
89+
try {
90+
agent = new File(source.getLocation().toURI());
91+
}
92+
catch (URISyntaxException ex) {
93+
agent = new File(source.getLocation().getPath());
94+
}
95+
return agent;
8896
}
8997
}
9098
}

0 commit comments

Comments
 (0)