com.edsdev.jconvert.util
Class ResourceManager

java.lang.Object
  extended bycom.edsdev.jconvert.util.ResourceManager

public class ResourceManager
extends java.lang.Object

To change the template for this generated type comment go to Window - Preferences - Java - Code Generation - Code and Comments

Author:
Ed Sarrazin

Constructor Summary
ResourceManager()
           
 
Method Summary
static java.awt.Image getImage(java.lang.String imageRelativeURL)
          Loads and Image from the classpath as a resource
static javax.swing.ImageIcon getImageIcon(java.lang.String imageRelativeURL)
          Gets and ImageIcom from the classloader based on the image resource URL
static java.lang.String getJarPath()
          Responsible for determining what the path is to the jar file.
static java.io.InputStream getResourceAsStream(java.lang.String resourceName)
          Attempts to find a resource in the classpath and returns an InputStream to that resrouce
static java.util.Properties loadProperties(java.io.InputStream Istream)
          Loads properties from an InputStream into a Properties object
static java.util.Properties loadProperties(java.lang.String filename)
          Loads a properties file from the classpath based on the name provided
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceManager

public ResourceManager()
Method Detail

getImage

public static java.awt.Image getImage(java.lang.String imageRelativeURL)
Loads and Image from the classpath as a resource

Parameters:
imageRelativeURL - relative url of the image you want to get
Returns:
Image object

loadProperties

public static java.util.Properties loadProperties(java.lang.String filename)
                                           throws java.io.IOException
Loads a properties file from the classpath based on the name provided

Parameters:
filename - Name of the file you want to load
Returns:
Properties object
Throws:
java.io.IOException

getResourceAsStream

public static java.io.InputStream getResourceAsStream(java.lang.String resourceName)
Attempts to find a resource in the classpath and returns an InputStream to that resrouce

Parameters:
resourceName - name of the resource you want to get as a stream
Returns:
stream to the resource

getJarPath

public static java.lang.String getJarPath()
Responsible for determining what the path is to the jar file.

Returns:
String representation of the path

loadProperties

public static java.util.Properties loadProperties(java.io.InputStream Istream)
                                           throws java.io.IOException
Loads properties from an InputStream into a Properties object

Parameters:
Istream - stream from which to load the properties file
Returns:
Properties object
Throws:
java.io.IOException

getImageIcon

public static javax.swing.ImageIcon getImageIcon(java.lang.String imageRelativeURL)
Gets and ImageIcom from the classloader based on the image resource URL

Parameters:
imageRelativeURL - relative url to load the image icon from
Returns:
ImageIcon


JConvert - opensource project by Ed Sarrazin