com.atlassian.crowd.service.client
Class BaseResourceLocator

java.lang.Object
  extended by com.atlassian.crowd.service.client.BaseResourceLocator
All Implemented Interfaces:
ResourceLocator
Direct Known Subclasses:
ClientResourceLocator

public abstract class BaseResourceLocator
extends Object
implements ResourceLocator

Abstract class with a few methods that will help locate a given resource


Field Summary
protected  org.slf4j.Logger logger
           
protected  String propertyFileLocation
           
 
Constructor Summary
protected BaseResourceLocator(String resourceName)
           
 
Method Summary
protected  String formatFileLocation(String fileLocation)
           
protected  URL getClassLoaderResource()
          Load a given resource.
 Properties getProperties()
          The Properties present within the given resource.
 String getResourceLocation()
          Will return the location of the resource on the file system.
protected  String getResourceLocationFromClassPath()
           
protected  String getResourceLocationFromSystemProperty()
          Returns the location of the property resourceName on the filesystem, based off the location of a system property, it is returned as a URL.toExternalForm();
 String getResourceName()
          The configured name of the resource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.slf4j.Logger logger

propertyFileLocation

protected String propertyFileLocation
Constructor Detail

BaseResourceLocator

protected BaseResourceLocator(String resourceName)
Method Detail

getResourceLocationFromSystemProperty

protected String getResourceLocationFromSystemProperty()
Returns the location of the property resourceName on the filesystem, based off the location of a system property, it is returned as a URL.toExternalForm();

Returns:
location of the resource

formatFileLocation

protected String formatFileLocation(String fileLocation)

getResourceLocationFromClassPath

protected String getResourceLocationFromClassPath()

getClassLoaderResource

protected URL getClassLoaderResource()
Load a given resource.

This method will try to load the resource using the following methods (in order):

Returns:
URL of the class loader resource

getResourceName

public String getResourceName()
Description copied from interface: ResourceLocator
The configured name of the resource

Specified by:
getResourceName in interface ResourceLocator
Returns:
name of resource

getProperties

public Properties getProperties()
Description copied from interface: ResourceLocator
The Properties present within the given resource.

Specified by:
getProperties in interface ResourceLocator
Returns:
Properties or null if no properties exist

getResourceLocation

public String getResourceLocation()
Description copied from interface: ResourceLocator
Will return the location of the resource on the file system. This will be in URI format similar to "file:/crowd/temp/crowd.properties"

Specified by:
getResourceLocation in interface ResourceLocator
Returns:
location of the resource


Copyright © 2013 Atlassian. All Rights Reserved.