Class SimpleResourceLocator

java.lang.Object
com.ardor3d.util.resource.SimpleResourceLocator
All Implemented Interfaces:
ResourceLocator
Direct Known Subclasses:
MultiFormatResourceLocator

public class SimpleResourceLocator extends Object implements ResourceLocator
This locator takes a base location for finding resources specified with a relative path. If it cannot find the path relative to the location, it successively omits the starting components of the relative path until it can find a resources with such a trimmed path. If no resource is found with this method null is returned.
  • Constructor Details

    • SimpleResourceLocator

      public SimpleResourceLocator(URI baseDir) throws URISyntaxException
      Construct a new SimpleResourceLocator using the given URI as our context.
      Parameters:
      baseDir - our base context. This is meant to be a "directory" wherein we will search for resources. Therefore, if it does not end in /, a / will be added to ensure we are talking about children of the given baseDir.
      Throws:
      NullPointerException - if the given URI is null.
      URISyntaxException - if the given URI does not end in / and we can not make a new URI with a trailing / from it.
    • SimpleResourceLocator

      public SimpleResourceLocator(URL baseDir) throws URISyntaxException
      Construct a new SimpleResourceLocator using the given URL as our context.
      Parameters:
      baseDir - our base context. This is converted to a URI. This is meant to be a "directory" wherein we will search for resources. Therefore, if it does not end in /, a / will be added to ensure we are talking about children of the given baseDir.
      Throws:
      NullPointerException - if the given URL is null.
      URISyntaxException - if this URL can not be converted to a URI, or if the converted URI does not end in / and we can not make a new URI with a trailing / from it.
  • Method Details