com.atlassian.crowd.integration.service.soap.client
Class BaseResourceLocator

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

public abstract class BaseResourceLocator
extends java.lang.Object
implements ResourceLocator

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


Field Summary
protected  org.apache.log4j.Logger logger
           
protected  java.lang.String propertyFileLocation
           
 
Constructor Summary
protected BaseResourceLocator(java.lang.String resourceName)
           
 
Method Summary
protected  java.lang.String formatFileLocation(java.lang.String fileLocation)
           
protected  java.net.URL getClassLoaderResource()
          Load a given resource.
 java.util.Properties getProperties()
          The Properties present within the given resource.
 java.lang.String getResourceLocation()
          Will return the location of the resource on the file system.
protected  java.lang.String getResourceLocationFromClassPath()
           
protected  java.lang.String getResourceLocationFromSystemProperty()
          Return's the location of the propertyResourceName on the filesystem, based off the location of a system property, it is returned as a URL.toExternalForm();
 java.lang.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.apache.log4j.Logger logger

propertyFileLocation

protected java.lang.String propertyFileLocation
Constructor Detail

BaseResourceLocator

protected BaseResourceLocator(java.lang.String resourceName)
Method Detail

getResourceLocationFromSystemProperty

protected java.lang.String getResourceLocationFromSystemProperty()
Return's the location of the propertyResourceName on the filesystem, based off the location of a system property, it is returned as a URL.toExternalForm();

Returns:

formatFileLocation

protected java.lang.String formatFileLocation(java.lang.String fileLocation)

getResourceLocationFromClassPath

protected java.lang.String getResourceLocationFromClassPath()

getClassLoaderResource

protected java.net.URL getClassLoaderResource()
Load a given resource.

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


getResourceName

public java.lang.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 java.util.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 java.lang.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 © 2009 Atlassian Pty Ltd. All Rights Reserved.