protected Object value() { ClassLoader classLoader = SchemaFactoryFinder.class.getClassLoader(); //return (ClassLoader.getSystemResource( SERVICE_ID )); return ss.getResourceAsURL(classLoader, SERVICE_ID); } };
String r = ss.getSystemProperty(propertyName); if(r!=null) { debugPrintln("The value is '"+r+"'"); String javah = ss.getSystemProperty( "java.home" ); String configFile = javah + File.separator + "lib" + File.separator + "jaxp.properties"; File f=new File( configFile ); firstTime = false; if(ss.doesFileExist(f)){ debugPrintln("Read properties file " + f); cacheProps.load(ss.getFileInputStream(f)); try { sf = loadFromService(schemaLanguage,resource.toExternalForm(), ss.getURLInputStream(resource)); if(sf!=null) return sf; } catch(IOException e) {
private void debugDisplayClassLoader() { try { if( classLoader == ss.getContextClassLoader() ) { debugPrintln("using thread context class loader ("+classLoader+") for search"); return; } } catch( Throwable _ ) { ; // getContextClassLoader() undefined in JDK1.1 } if( classLoader==ClassLoader.getSystemClassLoader() ) { debugPrintln("using system class loader ("+classLoader+") for search"); return; } debugPrintln("using class loader ("+classLoader+") for search"); }
try { final Enumeration e = ss.getResources(classLoader, SERVICE_ID); if(!e.hasMoreElements()) { debugPrintln("no "+SERVICE_ID+" file was found");
private static SecuritySupport ss = new SecuritySupport();
String r = SecuritySupport.getSystemProperty(propertyName); if (r != null) { if (debug) debugPrintln("The value is '"+r+"'"); String javah = SecuritySupport.getSystemProperty( "java.home" ); String configFile = javah + File.separator + "lib" + File.separator + "jaxp.properties"; File f=new File( configFile ); firstTime = false; if(SecuritySupport.doesFileExist(f)){ if (debug) debugPrintln("Read properties file " + f); cacheProps.load(SecuritySupport.getFileInputStream(f)); if (debug) debugPrintln("looking into " + resource); try { sf = loadFromServicesFile(schemaLanguage,resource.toExternalForm(),SecuritySupport.getURLInputStream(resource)); if(sf!=null) return sf; } catch(IOException e) {
private void debugDisplayClassLoader() { try { if( classLoader == SecuritySupport.getContextClassLoader() ) { debugPrintln("using thread context class loader ("+classLoader+") for search"); return; } } catch( Throwable _ ) { ; // getContextClassLoader() undefined in JDK1.1 } if( classLoader==ClassLoader.getSystemClassLoader() ) { debugPrintln("using system class loader ("+classLoader+") for search"); return; } debugPrintln("using class loader ("+classLoader+") for search"); }
try { final Enumeration e = SecuritySupport.getResources(classLoader, SERVICE_ID); if(debug && !e.hasMoreElements()) { debugPrintln("no "+SERVICE_ID+" file was found");
protected Object value() { ClassLoader classLoader = SchemaFactoryFinder.class.getClassLoader(); //return (ClassLoader.getSystemResource( SERVICE_ID )); return SecuritySupport.getResourceAsURL(classLoader, SERVICE_ID); } };
/** * <p>Search the specified classloader for the given classname.</p> * * @param classname the fully qualified name of the class to search for * @param loader the classloader to search * * @return the source location of the resource, or null if it wasn't found */ private static String which(String classname, ClassLoader loader) { String classnameAsResource = classname.replace('.', '/') + ".class"; if( loader==null ) loader = ClassLoader.getSystemClassLoader(); //URL it = loader.getResource(classnameAsResource); URL it = SecuritySupport.getResourceAsURL(loader, classnameAsResource); if (it != null) { return it.toString(); } else { return null; } } }
/** * <p>Search the specified classloader for the given classname.</p> * * @param classname the fully qualified name of the class to search for * @param loader the classloader to search * * @return the source location of the resource, or null if it wasn't found */ private static String which(String classname, ClassLoader loader) { String classnameAsResource = classname.replace('.', '/') + ".class"; if( loader==null ) loader = ClassLoader.getSystemClassLoader(); //URL it = loader.getResource(classnameAsResource); URL it = ss.getResourceAsURL(loader, classnameAsResource); if (it != null) { return it.toString(); } else { return null; } } }