1 55 56 package com.sun.org.apache.xerces.internal.parsers; 57 58 import java.io.*; 59 60 67 class SecuritySupport { 68 69 74 private static final Object securitySupport; 75 76 static { 77 SecuritySupport ss = null; 78 try { 79 Class c = Class.forName("java.security.AccessController"); 80 88 97 ss = new SecuritySupport12(); 98 } catch (Exception ex) { 99 } finally { 101 if (ss == null) 102 ss = new SecuritySupport(); 103 securitySupport = ss; 104 } 105 } 106 107 111 static SecuritySupport getInstance() { 112 return (SecuritySupport)securitySupport; 113 } 114 115 ClassLoader getContextClassLoader() { 116 return null; 117 } 118 119 ClassLoader getSystemClassLoader() { 120 return null; 121 } 122 123 ClassLoader getParentClassLoader(ClassLoader cl) { 124 return null; 125 } 126 127 String getSystemProperty(String propName) { 128 return System.getProperty(propName); 129 } 130 131 FileInputStream getFileInputStream(File file) 132 throws FileNotFoundException 133 { 134 return new FileInputStream(file); 135 } 136 137 InputStream getResourceAsStream(ClassLoader cl, String name) { 138 InputStream ris; 139 if (cl == null) { 140 ris = ClassLoader.getSystemResourceAsStream(name); 141 } else { 142 ris = cl.getResourceAsStream(name); 143 } 144 return ris; 145 } 146 147 boolean getFileExists(File f) { 148 return f.exists(); 149 } 150 151 long getLastModified(File f) { 152 return f.lastModified(); 153 } 154 } 155 | Popular Tags |