Skip to content

Commit 7ea73eb

Browse files
committed
Url no depricated version of url resolution
Signed-off-by: Gulshan <kumargu@amazon.com>
1 parent 791760a commit 7ea73eb

File tree

1 file changed

+4
-3
lines changed
  • libs/agent-sm/agent-policy/src/main/java/org/opensearch/secure_sm/policy

1 file changed

+4
-3
lines changed

libs/agent-sm/agent-policy/src/main/java/org/opensearch/secure_sm/policy/PolicyFile.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
import java.net.MalformedURLException;
1818
import java.net.NetPermission;
1919
import java.net.SocketPermission;
20+
import java.net.URI;
21+
import java.net.URISyntaxException;
2022
import java.net.URL;
2123
import java.net.URLDecoder;
2224
import java.nio.charset.StandardCharsets;
@@ -339,8 +341,7 @@ private static class PolicyInfo {
339341
}
340342
}
341343

342-
@SuppressWarnings("deprecation")
343-
private static URL newURL(String spec) throws MalformedURLException {
344-
return new URL(spec);
344+
private static URL newURL(String spec) throws MalformedURLException, URISyntaxException {
345+
return new URI(spec).toURL();
345346
}
346347
}

0 commit comments

Comments
 (0)