Class ResourceLoader


  • public class ResourceLoader
    extends java.lang.Object
    This class will handle loading resource files(AFM/CMAP). This was originally written for PDFBox but FontBox uses it as well. For now each project will have their own version.
    Version:
    $Revision: 1.1 $
    Author:
    Ben Litchfield
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Properties loadProperties​(java.lang.String resourceName)
      This will attempt to load the resource given the resource name.
      static java.util.Properties loadProperties​(java.lang.String resourceName, java.util.Properties defaults)
      This will attempt to load the resource given the resource name.
      static java.io.InputStream loadResource​(java.lang.String resourceName)
      This will attempt to load the resource given the resource name.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • loadResource

        public static java.io.InputStream loadResource​(java.lang.String resourceName)
                                                throws java.io.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:
        java.io.IOException - If there is an error while attempting to load the resource.
      • loadProperties

        public static java.util.Properties loadProperties​(java.lang.String resourceName)
                                                   throws java.io.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:
        java.io.IOException - If there is an error loading the properties.
      • loadProperties

        public static java.util.Properties loadProperties​(java.lang.String resourceName,
                                                          java.util.Properties defaults)
                                                   throws java.io.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:
        java.io.IOException - If there is an error loading the properties.