com.zmicer.utils
Class ResourceUtils

java.lang.Object
  extended by com.zmicer.utils.ResourceUtils

public class ResourceUtils
extends Object

The class is necessary for operating with resources (resource bundles, xml files etc.) - everything what could be called - it is a resource of my application. $Author:: zmicer $
$Rev:: 57 $
* $Date:: 2007-08-23 09:16:37 #$


Field Summary
static org.apache.log4j.Logger LOG
          Logger instance.
 
Constructor Summary
ResourceUtils()
           
 
Method Summary
static URL getResource(String name)
          Get resource as URL object.
static ResourceBundle getResourceBundle(String resourceName)
          Get ResourceBundle for the given base name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.log4j.Logger LOG
Logger instance.

Constructor Detail

ResourceUtils

public ResourceUtils()
Method Detail

getResourceBundle

public static ResourceBundle getResourceBundle(String resourceName)
Get ResourceBundle for the given base name. All the possible class loaders may help in the retrieving ResourceBundle, are used here. todo [zmicer]: seems to be this method could be adjusted to become more comprehensive.

Parameters:
resourceName - the base name of resource (e.g. when the file with bundle properties is called "JPatterns.properties", the base name would be "JPatterns"). Can not be null (otherwise IllegalArgumentException would appear). Be noticed the full name of the resource is allowed to be used here - in this case we would obtain it too.
Returns:
the ResourceBundle if exists or null. todo [zmicer]: please define all the features are implemented here. Update the unit tests. todo [zmicer]: code duplicate in the comparisson with the method above

getResource

public static URL getResource(String name)
Get resource as URL object.

Parameters:
name - the name of the resource to be found. Can not be null (otherwise IllegalArgumentException would appear).
Returns:
URL for the found resource or null todo [zmicer]: please define all the features are implemented here. Update the unit tests. todo [zmicer]: code duplicate in the comparisson with the method above


Copyright © 2007 jzmicer.team. All Rights Reserved.