Class BaseResourceLocator

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

public abstract class BaseResourceLocator extends Object implements ResourceLocator
Abstract class with a few methods that will help locate a given resource
  • Field Details

    • logger

      protected final org.slf4j.Logger logger
    • propertyFileLocation

      protected String propertyFileLocation
  • Constructor Details

    • BaseResourceLocator

      protected BaseResourceLocator(String resourceName)
  • Method Details

    • 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, boolean skipValidation)
    • 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