org.extex.resource
Interface ResourceFinder

All Known Subinterfaces:
CoreFontFactory, FontFactory
All Known Implementing Classes:
AbstractFinder, ClasspathArchiveFinder, ClasspathFinder, FileFinder, FileFinderRPath, FontFactoryImpl, LsrFinder, ResourceFinderImpl, ResourceFinderList

public interface ResourceFinder

This interface describes a class which is able to find files or other resources of different kinds for reading. It is not determined how the search is performed. Searching for the given file name, augmenting extension and path, or using an external library – like kpathsea – are left to possible implementations. Even an interaction with the user can be envisioned.

Version:
$Revision: 6871 $
Author:
Gerd Neugebauer

Method Summary
 void enableTracing(boolean flag)
          Enable or disable the tracing.
 NamedInputStream findResource(java.lang.String name, java.lang.String type)
          Find a resource which can be used for reading.
 

Method Detail

enableTracing

void enableTracing(boolean flag)
Enable or disable the tracing. The argument indicates whether tracing should be enabled or disabled. The resource finder can decide on its own how to perform tracing. The preferred way is to write tracing records to a logger.

Parameters:
flag - indicator whether tracing should be turned on or off.

findResource

NamedInputStream findResource(java.lang.String name,
                              java.lang.String type)
                              throws ConfigurationException
Find a resource which can be used for reading. If the search fails then null is returned.

Parameters:
name - the base name of the resource
type - the type, i.e. the extension
Returns:
the file or null if none could be found
Throws:
ConfigurationException - in case of an exception