first commit
This commit is contained in:
58
hrmsEjb/org/apache/xerces/parsers/SecuritySupport.java
Normal file
58
hrmsEjb/org/apache/xerces/parsers/SecuritySupport.java
Normal file
@@ -0,0 +1,58 @@
|
||||
package org.apache.xerces.parsers;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.InputStream;
|
||||
|
||||
class SecuritySupport {
|
||||
private static final Object securitySupport;
|
||||
|
||||
static {
|
||||
SecuritySupport ss = null;
|
||||
try {
|
||||
Class c = Class.forName("java.security.AccessController");
|
||||
ss = new SecuritySupport12();
|
||||
} catch (Exception ex) {
|
||||
|
||||
} finally {
|
||||
if (ss == null)
|
||||
ss = new SecuritySupport();
|
||||
securitySupport = ss;
|
||||
}
|
||||
}
|
||||
|
||||
static SecuritySupport getInstance() {
|
||||
return (SecuritySupport)securitySupport;
|
||||
}
|
||||
|
||||
ClassLoader getContextClassLoader() {
|
||||
return null;
|
||||
}
|
||||
|
||||
String getSystemProperty(String propName) {
|
||||
return System.getProperty(propName);
|
||||
}
|
||||
|
||||
FileInputStream getFileInputStream(File file) throws FileNotFoundException {
|
||||
return new FileInputStream(file);
|
||||
}
|
||||
|
||||
InputStream getResourceAsStream(ClassLoader cl, String name) {
|
||||
InputStream ris;
|
||||
if (cl == null) {
|
||||
ris = ClassLoader.getSystemResourceAsStream(name);
|
||||
} else {
|
||||
ris = cl.getResourceAsStream(name);
|
||||
}
|
||||
return ris;
|
||||
}
|
||||
|
||||
boolean getFileExists(File f) {
|
||||
return f.exists();
|
||||
}
|
||||
|
||||
long getLastModified(File f) {
|
||||
return f.lastModified();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user