Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| fop 1.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.fop.afp.util
Class SimpleResourceAccessor

    java.lang.Object
      org.apache.fop.afp.util.SimpleResourceAccessor

All Implemented Interfaces:
  ResourceAccessor

Direct Known Subclasses:
  DefaultFOPResourceAccessor

public class SimpleResourceAccessor
extends java.lang.Object
implements ResourceAccessor

Simple implementation of the `ResourceAccessor` interface for access relative to a base URI.

Constructor Summary
`SimpleResourceAccessor(java.io.File baseDir)` Creates a new simple resource accessor.
`SimpleResourceAccessor(java.net.URI baseURI)` Creates a new simple resource accessor.

Method Summary
`java.io.InputStream` | `createInputStream(java.net.URI uri)` Creates a new `InputStream` for the given URI that allows read access to an external resource.
`java.net.URI` | `getBaseURI()` Returns the base URI.
`protected java.net.URI` | `resolveAgainstBase(java.net.URI uri)` Resolve the given URI against the baseURI.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SimpleResourceAccessor

    public SimpleResourceAccessor(java.net.URI baseURI)

  Creates a new simple resource accessor.

Parameters:
  `baseURI` - the base URI to resolve relative URIs against (may be null)

### SimpleResourceAccessor

    public SimpleResourceAccessor(java.io.File baseDir)

  Creates a new simple resource accessor.

Parameters:
  `baseDir` - the base directory to resolve relative filenames against (may be null)

Method Detail

### getBaseURI

    public java.net.URI getBaseURI()

  Returns the base URI.

  Returns:
    the base URI (or null if no base URI was set)

### resolveAgainstBase

    protected java.net.URI resolveAgainstBase(java.net.URI uri)

  Resolve the given URI against the baseURI.

  Parameters:
    `uri` - the URI to resolve
  Returns:
    the resolved URI

### createInputStream

    public java.io.InputStream createInputStream(java.net.URI uri)
                                          throws java.io.IOException

  Creates a new `InputStream` for the given URI that allows read access to an external resource.

  Specified by:
    `createInputStream` in interface `ResourceAccessor`
  Parameters:
    `uri` - the URI of an external resource.
  Returns:
    the new input stream
  Throws:
    `java.io.IOException` - if an I/O error occurs while opening the resource

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| fop 1.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 1999-2010 The Apache Software Foundation. All Rights Reserved.