1 16 19 20 package org.apache.xml.utils; 21 22 import java.io.File ; 23 import java.io.FileInputStream ; 24 import java.io.FileNotFoundException ; 25 import java.io.InputStream ; 26 27 import java.util.Properties ; 28 29 36 class SecuritySupport { 37 38 43 private static final Object securitySupport; 44 45 static { 46 SecuritySupport ss = null; 47 try { 48 Class c = Class.forName("java.security.AccessController"); 49 57 66 ss = new SecuritySupport12(); 67 } catch (Exception ex) { 68 } finally { 70 if (ss == null) 71 ss = new SecuritySupport(); 72 securitySupport = ss; 73 } 74 } 75 76 80 static SecuritySupport getInstance() { 81 return (SecuritySupport)securitySupport; 82 } 83 84 ClassLoader getContextClassLoader() { 85 return null; 86 } 87 88 ClassLoader getSystemClassLoader() { 89 return null; 90 } 91 92 ClassLoader getParentClassLoader(ClassLoader cl) { 93 return null; 94 } 95 96 String getSystemProperty(String propName) { 97 return System.getProperty(propName); 98 } 99 100 FileInputStream getFileInputStream(File file) 101 throws FileNotFoundException 102 { 103 return new FileInputStream (file); 104 } 105 106 InputStream getResourceAsStream(ClassLoader cl, String name) { 107 InputStream ris; 108 if (cl == null) { 109 ris = ClassLoader.getSystemResourceAsStream(name); 110 } else { 111 ris = cl.getResourceAsStream(name); 112 } 113 return ris; 114 } 115 116 boolean getFileExists(File f) { 117 return f.exists(); 118 } 119 120 long getLastModified(File f) { 121 return f.lastModified(); 122 } 123 } 124 | Popular Tags |