private URL getResource(String filename, ClassLoader myClassLoader, boolean updateStatus) { URL url = Loader.getResource(filename, myClassLoader); if (updateStatus) { statusOnResourceSearch(filename, myClassLoader, url); } return url; }
private URL urlByResourceName(StatusManager sm, String resourceName) { sm.add(new InfoStatus("Searching for [" + resourceName + "]", this)); URL url = Loader.getResource(resourceName, Loader.getTCL()); if (url != null) { return url; } return Loader.getResourceBySelfClassLoader(resourceName); }
private URL urlByResourceName(StatusManager sm, String resourceName) { sm.add(new InfoStatus("Searching for [" + resourceName + "]", this)); URL url = Loader.getResource(resourceName, Loader.getTCL()); if (url != null) { return url; } return Loader.getResourceBySelfClassLoader(resourceName); }
private URL findConfigFileURLFromSystemProperties(ClassLoader classLoader, boolean updateStatus) { String logbackConfigFile = OptionHelper.getSystemProperty(CONFIG_FILE_PROPERTY); if (logbackConfigFile != null) { URL result = null; try { result = new URL(logbackConfigFile); return result; } catch (MalformedURLException e) { // so, resource is not a URL: // attempt to get the resource from the class path result = Loader.getResource(logbackConfigFile, classLoader); if (result != null) { return result; } File f = new File(logbackConfigFile); if (f.exists() && f.isFile()) { try { result = f.toURI().toURL(); return result; } catch (MalformedURLException e1) { } } } finally { if (updateStatus) { statusOnResourceSearch(logbackConfigFile, classLoader, result); } } } return null; }
private URL urlByResourceName(StatusManager sm, String resourceName) { sm.add(new InfoStatus("Searching for [" + resourceName + "]", this)); URL url = Loader.getResource(resourceName, Loader.getTCL()); if (url != null) { return url; } return Loader.getResourceBySelfClassLoader(resourceName); }
private URL getResource(String filename, ClassLoader myClassLoader, boolean updateStatus) { URL url = Loader.getResource(filename, myClassLoader); if (updateStatus) { statusOnResourceSearch(filename, myClassLoader, url); } return url; }
private URL urlByResourceName(StatusManager sm, String resourceName) { sm.add(new InfoStatus("Searching for [" + resourceName + "]", this)); URL url = Loader.getResource(resourceName, Loader.getTCL()); if (url != null) { return url; } return Loader.getResourceBySelfClassLoader(resourceName); }
/** * Attempt to find a resource by using the classloader that loaded this class, * namely Loader.class. * * @param resource * @return */ public static URL getResourceBySelfClassLoader(String resource) { return getResource(resource, getClassLoaderOfClass(Loader.class)); }
private URL urlByResourceName(StatusManager sm, String resourceName) { sm.add(new InfoStatus("Searching for [" + resourceName + "]", this)); URL url = Loader.getResource(resourceName, Loader.getTCL()); if (url != null) { return url; } return Loader.getResourceBySelfClassLoader(resourceName); }
private URL findConfigFileURLFromSystemProperties(ClassLoader classLoader, boolean updateStatus) { String logbackConfigFile = OptionHelper.getSystemProperty(CONFIG_FILE_PROPERTY); if (logbackConfigFile != null) { URL result = null; try { result = new URL(logbackConfigFile); return result; } catch (MalformedURLException e) { // so, resource is not a URL: // attempt to get the resource from the class path result = Loader.getResource(logbackConfigFile, classLoader); if (result != null) { return result; } File f = new File(logbackConfigFile); if (f.exists() && f.isFile()) { try { result = f.toURI().toURL(); return result; } catch (MalformedURLException e1) { } } } finally { if (updateStatus) { statusOnResourceSearch(logbackConfigFile, classLoader, result); } } } return null; }
private URL urlByResourceName(StatusManager sm, String resourceName) { sm.add(new InfoStatus("Searching for [" + resourceName + "]", this)); URL url = Loader.getResource(resourceName, Loader.getTCL()); if (url != null) { return url; } return Loader.getResourceBySelfClassLoader(resourceName); }
/** * Attempt to find a resource by using the classloader that loaded this class, * namely Loader.class. * * @param resource * @return */ public static URL getResourceBySelfClassLoader(String resource) { return getResource(resource, getClassLoaderOfClass(Loader.class)); }
/** * Attempt to find a resource by using the classloader that loaded this class, * namely Loader.class. * * @param resource the resource name to look for * @return resource URL */ public static URL getResourceBySelfClassLoader(String resource) { return getResource(resource, getClassLoaderOfClass(Loader.class)); }
/** * Attempt to find a resource by using the classloader that loaded this class, * namely Loader.class. * * @param resource * @return */ public static URL getResourceBySelfClassLoader(String resource) { return getResource(resource, getClassLoaderOfClass(Loader.class)); }
private URL getResource(String filename, ClassLoader myClassLoader, boolean updateStatus) { URL url = Loader.getResource(filename, myClassLoader); if (updateStatus) { statusOnResourceSearch(filename, myClassLoader, url); } return url; }
/** * Attempt to find a resource by using the classloader that loaded this class, * namely Loader.class. * * @param resource * @return */ public static URL getResourceBySelfClassLoader(String resource) { return getResource(resource, getClassLoaderOfClass(Loader.class)); }
/** * Attempt to find a resource by using the classloader that loaded this class, * namely Loader.class. * * @param resource * @return */ public static URL getResourceBySelfClassLoader(String resource) { return getResource(resource, getClassLoaderOfClass(Loader.class)); }
/** * Attempt to find a resource by using the classloader that loaded this class, * namely Loader.class. * * @param resource * @return */ public static URL getResourceBySelfClassLoader(String resource) { return getResource(resource, getClassLoaderOfClass(Loader.class)); }
private URL getResource(String filename, ClassLoader myClassLoader, boolean updateStatus) { URL url = Loader.getResource(filename, myClassLoader); if (updateStatus) { statusOnResourceSearch(filename, myClassLoader, url); } return url; }
private URL searchAsResource(String filename) { URL result = Loader.getResource(filename, getClass().getClassLoader()); if (result != null) addInfo("Found [" + filename + "] as a resource."); else addInfo("Could NOT find [" + filename + "] as a resource."); return result; }