org.apache.ode.bpel.compiler

## Class DefaultResourceFinder

- java.lang.Object
- - org.apache.ode.bpel.compiler.DefaultResourceFinder

- All Implemented Interfaces:
    ResourceFinder

      public class DefaultResourceFinder
      extends java.lang.Object
      implements ResourceFinder

  Basic implementation of the `ResourceFinder` interface. Resolves URIs relative to a base URI specified at the time of construction.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultResourceFinder()` Default constructor: resolve relative URIs against current working directory.
    `DefaultResourceFinder(java.io.File relativeDir, java.io.File absoluteDir)` Constructor: resolve relative URIs against specified directory.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.net.URI` | `getBaseResourceURI()`
    `java.io.InputStream` | `openResource(java.net.URI uri)` Obtain an input stream to the resource at the given URI.
    `java.net.URI` | `resolve(java.net.URI parent, java.net.URI child)`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultResourceFinder

          public DefaultResourceFinder()

      Default constructor: resolve relative URIs against current working directory.

    - #### DefaultResourceFinder

          public DefaultResourceFinder(java.io.File relativeDir,
                               java.io.File absoluteDir)

      Constructor: resolve relative URIs against specified directory.
      Parameters:
        `relativeDir` - base path for relative URLs.
        `absoluteDir` - base path for absolute URLs.

  - ### Method Detail

    - #### openResource

          public java.io.InputStream openResource(java.net.URI uri)
                                           throws java.net.MalformedURLException,
                                                  java.io.IOException

      Description copied from interface: `ResourceFinder`
      Obtain an input stream to the resource at the given URI.
      Specified by:
        `openResource` in interface `ResourceFinder`
      Parameters:
        `uri` - resource URI
      Returns:
        input stream or `null` if the resource is not found
      Throws:
        `java.net.MalformedURLException` - in case of invalid URI
        `java.io.IOException` - in case of read error

    - #### getBaseResourceURI

          public java.net.URI getBaseResourceURI()

      Specified by:
        `getBaseResourceURI` in interface `ResourceFinder`

    - #### resolve

          public java.net.URI resolve(java.net.URI parent,
                             java.net.URI child)

      Specified by:
        `resolve` in interface `ResourceFinder`