Skip to content

Commit dc7e124

Browse files
committed
Remove depricated get Url
1 parent 43de546 commit dc7e124

File tree

1 file changed

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

1 file changed

+4
-13
lines changed

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

Lines changed: 4 additions & 13 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;
@@ -38,16 +40,6 @@
3840

3941
@SuppressWarnings("removal")
4042
public class PolicyFile extends java.security.Policy {
41-
public static final Set<String> PERM_CLASSES_TO_SKIP = Set.of(
42-
"org.opensearch.secure_sm.ThreadContextPermission",
43-
"org.opensearch.secure_sm.ThreadPermission",
44-
"org.opensearch.SpecialPermission",
45-
"org.bouncycastle.crypto.CryptoServicesPermission",
46-
"org.opensearch.script.ClassPermission",
47-
"javax.security.auth.AuthPermission",
48-
"javax.security.auth.kerberos.ServicePermission"
49-
);
50-
5143
public static final Set<Class<?>> KNOWN_PERM_CLASSES = Set.of(
5244
SocketPermission.class,
5345
FilePermission.class,
@@ -355,8 +347,7 @@ private static class PolicyInfo {
355347
}
356348
}
357349

358-
@SuppressWarnings("deprecation")
359-
private static URL newURL(String spec) throws MalformedURLException {
360-
return new URL(spec);
350+
private static URL newURL(String spec) throws MalformedURLException, URISyntaxException {
351+
return new URI(spec).toURL();
361352
}
362353
}

0 commit comments

Comments
 (0)