mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Convert URL to File using a URI so that URL-encoding is removed
Fixes #1429
This commit is contained in:
parent
95d65c2ff5
commit
28f7cf4487
@ -17,6 +17,7 @@
|
||||
package org.springframework.boot.gradle.agent;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URISyntaxException;
|
||||
import java.security.CodeSource;
|
||||
|
||||
import org.gradle.api.Action;
|
||||
@ -84,7 +85,14 @@ public class AgentTasksEnhancer implements Action<Project> {
|
||||
if (loaded != null) {
|
||||
CodeSource source = loaded.getProtectionDomain().getCodeSource();
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user