/** * Returns the inputstream for the resource specified by the * <strong>absolute</strong> name. * * @param name the name of the resource * @param context the source class * @return the url of the resource or null, if not found. */ public static InputStream getResourceAsStream(final String name, final Class context) { final URL url = getResource(name, context); if (url == null) { return null; } try { return url.openStream(); } catch (IOException e) { return null; } }
/** * Returns the inputstream for the resource specified by the * <strong>absolute</strong> name. * * @param name the name of the resource * @param context the source class * @return the url of the resource or null, if not found. */ public static InputStream getResourceAsStream(final String name, final Class context) { final URL url = getResource(name, context); if (url == null) { return null; } try { return url.openStream(); } catch (IOException e) { return null; } }
/** * Returns the inputstream for the resource specified by the * <strong>absolute</strong> name. * * @param name the name of the resource * @param context the source class * @return the url of the resource or null, if not found. */ public static InputStream getResourceAsStream(final String name, final Class context) { final URL url = getResource(name, context); if (url == null) { return null; } try { return url.openStream(); } catch (IOException e) { return null; } }
/** * Returns a URL pointing to a resource located in the classpath. The * resource is looked up using the given key. * <p/> * Example: The load a file named 'logo.gif' which is stored in a java * package named 'org.jfree.resources': * <pre> * mainmenu.logo=org/jfree/resources/logo.gif * </pre> * The URL for that file can be queried with: <code>getResource("mainmenu.logo");</code>. * * @param key the key for the resource * @return the resource URL */ public URL getResourceURL(final String key) { final String name = getString(key); final URL in = ObjectUtilities.getResource(name, ResourceBundleSupport.class); if (in == null) { Log.warn("Unable to find file in the class path: " + name + "; key=" + key); } return in; }
/** * Returns a URL pointing to a resource located in the classpath. The * resource is looked up using the given key. * <p> * Example: The load a file named 'logo.gif' which is stored in a java * package named 'org.jfree.resources':</p> * <pre> * mainmenu.logo=org/jfree/resources/logo.gif * </pre> * The URL for that file can be queried with: <code>getResource("mainmenu.logo");</code>. * * @param key the key for the resource * @return the resource URL */ public URL getResourceURL(final String key) { final String name = getString(key); final URL in = ObjectUtilities.getResource(name, ResourceBundleSupport.class); if (in == null) { Log.warn("Unable to find file in the class path: " + name + "; key=" + key); } return in; }
/** * Returns a URL pointing to a resource located in the classpath. The * resource is looked up using the given key. * <p/> * Example: The load a file named 'logo.gif' which is stored in a java * package named 'org.jfree.resources': * <pre> * mainmenu.logo=org/jfree/resources/logo.gif * </pre> * The URL for that file can be queried with: <code>getResource("mainmenu.logo");</code>. * * @param key the key for the resource * @return the resource URL */ public URL getResourceURL(final String key) { final String name = getString(key); final URL in = ObjectUtilities.getResource(name, ResourceBundleSupport.class); if (in == null) { Log.warn("Unable to find file in the class path: " + name + "; key=" + key); } return in; }
final boolean large) final URL in = ObjectUtilities.getResource(resourceName, ResourceBundleSupport.class);
final boolean large) final URL in = ObjectUtilities.getResource(resourceName, ResourceBundleSupport.class);
final boolean large) final URL in = ObjectUtilities.getResource(resourceName, ResourceBundleSupport.class);