Class ResourceLoader

java.lang.Object
org.apache.pdfbox.util.ResourceLoader

public class ResourceLoader extends Object
This class will handle loading resource files(AFM/CMAP).
Version:
$Revision: 1.9 $
Author:
Ben Litchfield
  • Method Details

    • loadResource

      public static InputStream loadResource(String resourceName) throws IOException
      This will attempt to load the resource given the resource name.
      Parameters:
      resourceName - The resource to try and load.
      Returns:
      The resource as a stream or null if it could not be found.
      Throws:
      IOException - If there is an error while attempting to load the resource.
    • loadProperties

      public static Properties loadProperties(String resourceName, boolean failIfNotFound) throws IOException
      This will attempt to load the resource given the resource name.
      Parameters:
      resourceName - The resource to try and load.
      failIfNotFound - Throw an error message if the properties were not found.
      Returns:
      The resource as a stream or null if it could not be found.
      Throws:
      IOException - If there is an error loading the properties.
    • loadProperties

      public static Properties loadProperties(String resourceName, Properties defaults) throws IOException
      This will attempt to load the resource given the resource name.
      Parameters:
      resourceName - The resource to try and load.
      defaults - A stream of default properties.
      Returns:
      The resource as a stream or null if it could not be found.
      Throws:
      IOException - If there is an error loading the properties.