org.apache.velocity.tools.config

## Class FileFactoryConfiguration

- java.lang.Object
- - org.apache.velocity.tools.config.Configuration
  - - org.apache.velocity.tools.config.CompoundConfiguration<ToolboxConfiguration>
    - - org.apache.velocity.tools.config.FactoryConfiguration
      - - org.apache.velocity.tools.config.FileFactoryConfiguration

All Implemented Interfaces:
  Comparable<Configuration>

Direct Known Subclasses:
  PropertiesFactoryConfiguration, XmlFactoryConfiguration

    public abstract class FileFactoryConfiguration
    extends FactoryConfiguration

Provides support for reading a configuration file from a specified path.

Version:
  $Id: XmlFactoryConfiguration.java 511959 2007-02-26 19:24:39Z nbubna $
Author:
  Nathan Bubna

### Constructor Summary

Constructors
`protected` `FileFactoryConfiguration(Class clazz, String id)`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`protected URL` `findURL(String path)`
`void` `read(String path)` Reads a configuration file from the specified file path and sets up the configuration from that.
`void` `read(String path, boolean required)`
`void` `read(String path, boolean required, org.slf4j.Logger log)`
`void` `read(URL url)`
`void` `read(URL url, boolean required)`
`protected void` `read(URL url, boolean required, org.slf4j.Logger log)`
`protected abstract void` `readImpl(URL url)` Reads an configuration from an `URL`.

### Methods inherited from class org.apache.velocity.tools.config.FactoryConfiguration

`addConfiguration, addData, addSource, addToolbox, createFactory, equals, getData, getData, getData, getSource, getSources, getToolbox, getToolboxes, hasData, hashCode, removeData, removeToolbox, setData, setSource, setToolboxes, toString, toString, validate`

### Methods inherited from class org.apache.velocity.tools.config.CompoundConfiguration

`addChild, addConfiguration, appendChildren, getChild, getChildren, hasChildren, removeChild, setChildren`

### Methods inherited from class org.apache.velocity.tools.config.Configuration

`addConfiguration, addProperty, appendProperties, compareTo, getProperties, getProperty, getPropertyMap, hasProperties, removeProperty, removeProperty, setProperties, setProperty, setPropertyMap`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### FileFactoryConfiguration

    protected FileFactoryConfiguration(Class clazz,
                                       String id)

### Method Detail

#### readImpl

    protected abstract void readImpl(URL url)
                              throws IOException

Reads an configuration from an `URL`.

Parameters:
  `url` - the InputStream to read from
Throws:
  `IOException` - if a problem occurs

#### read

    public void read(String path)

Reads a configuration file from the specified file path and sets up the configuration from that. If the file does not exist, a `ResourceNotFoundException` will be thrown.

Parameters:
  `path` - the path to the file to be read from

#### read

    public void read(URL url)

#### read

    public void read(String path,
                     boolean required)

#### read

    public void read(URL url,
                     boolean required)

#### read

    public void read(String path,
                     boolean required,
                     org.slf4j.Logger log)

#### findURL

    protected URL findURL(String path)

#### read

    protected void read(URL url,
                        boolean required,
                        org.slf4j.Logger log)