org.extex.main.tex
Class ResourceFinderImpl

java.lang.Object
  extended by org.extex.main.tex.ResourceFinderImpl
All Implemented Interfaces:
LogEnabled, InteractionAware, RecursiveFinder, ResourceFinder

public class ResourceFinderImpl
extends java.lang.Object
implements ResourceFinder, RecursiveFinder, LogEnabled, InteractionAware

This ResourceFinder queries the user for the name of the file to use and tries to find it via its parent.

Version:
$Revision: 6871 $
Author:
Gerd Neugebauer

Constructor Summary
ResourceFinderImpl(Configuration theConfiguration)
          Creates a new object.
 
Method Summary
 void enableLogging(java.util.logging.Logger theLogger)
          Setter for the logger.
 void enableTracing(boolean flag)
          Setter for the trace flag.
 NamedInputStream findResource(java.lang.String name, java.lang.String type)
          Find a resource which can be used for reading.
 void setInteractionProvider(InteractionIndicator provider)
          Setter for the interaction provider.
 void setParent(ResourceFinder parent)
          Setter for the parent resource finder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceFinderImpl

public ResourceFinderImpl(Configuration theConfiguration)
Creates a new object.

Parameters:
theConfiguration - the configuration to use
Method Detail

enableLogging

public void enableLogging(java.util.logging.Logger theLogger)
Setter for the logger.

Specified by:
enableLogging in interface LogEnabled
Parameters:
theLogger - the logger to use
See Also:
LogEnabled.enableLogging( java.util.logging.Logger)

enableTracing

public void enableTracing(boolean flag)
Setter for the trace flag. The trace flag is currently ignored.

Specified by:
enableTracing in interface ResourceFinder
Parameters:
flag - the trace flag
See Also:
ResourceFinder.enableTracing(boolean)

findResource

public 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.

Specified by:
findResource in interface ResourceFinder
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
See Also:
ResourceFinder.findResource( java.lang.String, java.lang.String)

setInteractionProvider

public void setInteractionProvider(InteractionIndicator provider)
Setter for the interaction provider.

Specified by:
setInteractionProvider in interface InteractionAware
Parameters:
provider - the provider
See Also:
InteractionAware.setInteractionProvider( org.extex.resource.InteractionIndicator)

setParent

public void setParent(ResourceFinder parent)
Setter for the parent resource finder.

Specified by:
setParent in interface RecursiveFinder
Parameters:
parent - the parent resource finder
See Also:
RecursiveFinder.setParent( org.extex.resource.ResourceFinder)