org.javagen.agile.core.util
Class ResourceLoader

java.lang.Object
  extended by org.javagen.agile.core.util.ResourceLoader

public class ResourceLoader
extends Object

Convenience methods for loading Spring-like resources. For example: classpath:email.properties or file:user.properties

Author:
Richard Easterling

Field Summary
static String CLASSPATH_URL_PREFIX
          Pseudo URL prefix for loading from the class path: "classpath:"
static String FILE_URL_PREFIX
          URL prefix for loading from the file system: "file:"
 
Constructor Summary
ResourceLoader()
           
 
Method Summary
static boolean exists(Class<?> clazz, String resourceURL)
           
static boolean exists(String resourceURL)
           
static InputStream inputStream(Class<?> clazz, String resourceURL)
           
static InputStream inputStream(String resourceURL)
           
static Properties properties(Class<?> clazz, String resourceURL, Properties props)
           
static Properties properties(String resourceURL)
           
static Properties properties(String resourceURL, Properties props)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASSPATH_URL_PREFIX

public static final String CLASSPATH_URL_PREFIX
Pseudo URL prefix for loading from the class path: "classpath:"

See Also:
Constant Field Values

FILE_URL_PREFIX

public static final String FILE_URL_PREFIX
URL prefix for loading from the file system: "file:"

See Also:
Constant Field Values
Constructor Detail

ResourceLoader

public ResourceLoader()
Method Detail

exists

public static boolean exists(String resourceURL)

exists

public static boolean exists(Class<?> clazz,
                             String resourceURL)

inputStream

public static InputStream inputStream(String resourceURL)
                               throws IOException
Throws:
IOException

inputStream

public static InputStream inputStream(Class<?> clazz,
                                      String resourceURL)
                               throws IOException
Throws:
IOException

properties

public static Properties properties(String resourceURL)
                             throws IOException
Throws:
IOException

properties

public static Properties properties(String resourceURL,
                                    Properties props)
                             throws IOException
Throws:
IOException

properties

public static Properties properties(Class<?> clazz,
                                    String resourceURL,
                                    Properties props)
                             throws IOException
Throws:
IOException


Copyright 2006-2006-2007 Outsource Cafe Inc.. All Rights Reserved.