Skip to content

Commit 2b18f7d

Browse files
committed
remove depricated url method
1 parent 0942b10 commit 2b18f7d

File tree

1 file changed

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

1 file changed

+5
-3
lines changed

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

Lines changed: 5 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;
@@ -341,8 +343,8 @@ private static class PolicyInfo {
341343
}
342344
}
343345

344-
@SuppressWarnings("deprecation")
345-
private static URL newURL(String spec) throws MalformedURLException {
346-
return new URL(spec);
346+
private static URL newURL(String spec) throws MalformedURLException, URISyntaxException {
347+
348+
return new URI(spec).toURL();
347349
}
348350
}

0 commit comments

Comments
 (0)