org.apache.fontbox.util

Class ResourceLoader

public class ResourceLoader extends 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
static PropertiesloadProperties(String resourceName)
This will attempt to load the resource given the resource name.
static PropertiesloadProperties(String resourceName, Properties defaults)
This will attempt to load the resource given the resource name.
static InputStreamloadResource(String resourceName)
This will attempt to load the resource given the resource name.

Method Detail

loadProperties

public static Properties loadProperties(String resourceName)
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 loading the properties.

loadProperties

public static Properties loadProperties(String resourceName, Properties defaults)
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.

loadResource

public static InputStream loadResource(String resourceName)
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.

Copyright © 2008-2010 Apache Software Foundation. All Rights Reserved.