mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 11:04:34 +02:00
8129572: Cleanup usage of getResourceAsStream in jaxp
Reviewed-by: alanb, joehw, mchung, redestad
This commit is contained in:
parent
9ced0d90d5
commit
4ebbfc918f
14 changed files with 17 additions and 239 deletions
|
@ -28,7 +28,6 @@ package javax.xml.validation;
|
|||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.security.*;
|
||||
import java.net.*;
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
|
@ -134,23 +133,6 @@ class SecuritySupport {
|
|||
}
|
||||
}
|
||||
|
||||
InputStream getResourceAsStream(final ClassLoader cl,
|
||||
final String name)
|
||||
{
|
||||
return (InputStream)
|
||||
AccessController.doPrivileged(new PrivilegedAction() {
|
||||
public Object run() {
|
||||
InputStream ris;
|
||||
if (cl == null) {
|
||||
ris = Object.class.getResourceAsStream(name);
|
||||
} else {
|
||||
ris = cl.getResourceAsStream(name);
|
||||
}
|
||||
return ris;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
boolean doesFileExist(final File f) {
|
||||
return ((Boolean)
|
||||
AccessController.doPrivileged(new PrivilegedAction() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue