Class ResourceLoader

java.lang.Object
io.wcm.devops.conga.resource.ResourceLoader

public final class ResourceLoader extends Object
Resource loader to read resource and resource collections from filesystem or classpath.
  • Field Details

    • FILE_PREFIX

      public static final String FILE_PREFIX
      Path prefix for explicitly referencing a file.
      See Also:
    • CLASSPATH_PREFIX

      public static final String CLASSPATH_PREFIX
      Path prefix for explicitly referencing a classpath resource.
      See Also:
  • Constructor Details

    • ResourceLoader

      public ResourceLoader()
      Constructor.
    • ResourceLoader

      public ResourceLoader(ClassLoader classLoader)
      Constructor with custom class loader.
      Parameters:
      classLoader - Class loader
  • Method Details

    • getResource

      public Resource getResource(String path)
      Get resource from filesystem (preferred) or classpath.
      Parameters:
      path - Path
      Returns:
      Resource or null if not found
    • getResource

      public Resource getResource(ResourceCollection dir, String path)
      Get resource from filesystem (preferred) or classpath.
      Parameters:
      dir - Parent directory
      path - Resource path relative to parent directory
      Returns:
      Resource or null if not found
    • getResourceCollection

      public ResourceCollection getResourceCollection(String path)
      Get resource collection from filesystem (preferred) or classpath.
      Parameters:
      path - Path
      Returns:
      Resource or null if not found
    • getResourceCollection

      public ResourceCollection getResourceCollection(ResourceCollection dir, String path)
      Get resource collection from filesystem (preferred) or classpath.
      Parameters:
      dir - Parent directory
      path - Resource path relative to parent directory
      Returns:
      Resource or null if not found