de.dante.extex.main
Class ResourceFinderImpl

java.lang.Object
  extended byde.dante.extex.main.ResourceFinderImpl
All Implemented Interfaces:
InteractionAware, LogEnabled, 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: 1.15 $
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.
 java.io.InputStream findResource(java.lang.String name, java.lang.String type)
          Find a resource which can be used for reading.
 void setInteractionProvider(InteractionProvider 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)
                   throws ConfigurationException
Creates a new object.

Parameters:
theConfiguration - the configuration to use
Throws:
ConfigurationException - in case of an error in the configuration
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 java.io.InputStream findResource(java.lang.String name,
                                        java.lang.String type)
                                 throws ConfigurationException
Description copied from interface: ResourceFinder
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(InteractionProvider provider)
Description copied from interface: InteractionAware
Setter for the interaction provider.

Specified by:
setInteractionProvider in interface InteractionAware
Parameters:
provider - the provider
See Also:
InteractionAware.setInteractionProvider( de.dante.util.resource.InteractionProvider)

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( de.dante.util.resource.ResourceFinder)