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

## org.eclipse.birt.report.model.api
Class DefaultResourceLocator

    java.lang.Object
      org.eclipse.birt.report.model.api.DefaultResourceLocator

All Implemented Interfaces:
  IResourceLocator

    public class DefaultResourceLocator

extends java.lang.Object
implements IResourceLocator

The default file search algorithm. It searches for a given file in the 'base' folder of a design. If the 'base' property of the design was not set, then this class looks in folder where the design file is located.

The detail search mechanism is:

- If the the file to be found is given by an absolute path, returns that path.
- If it is a relative file path, search the 'base' folder of the design.
- If the 'base' property of the design is not set, then search the file in the folder where the design file locates.

See Also:
  `IResourceLocator`, `SessionHandle`

Field Summary
`protected static java.util.logging.Logger` | `logger` the logger

Fields inherited from interface org.eclipse.birt.report.model.api.IResourceLocator
`CASCADING_STYLE_SHEET, FRAGMENT_RESOURCE_HOST, IMAGE, JAR_FILE, LIBRARY, MESSAGE_FILE, OTHERS`

Constructor Summary
`DefaultResourceLocator()`

Method Summary
`java.net.URL` | `findResource(ModuleHandle moduleHandle, java.lang.String fileName, int type)` Searches the file by the given file name.

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

Field Detail

### logger

    protected static java.util.logging.Logger logger

  the logger

Constructor Detail

### DefaultResourceLocator

    public DefaultResourceLocator()

Method Detail

### findResource

    public java.net.URL findResource(ModuleHandle moduleHandle,
                                     java.lang.String fileName,
                                     int type)

  Description copied from interface: `IResourceLocator`
  Searches the file by the given file name. The actual search algorithm will be different in different environment. The file type is just helpful when different file searching steps for different files are required. Because new file type will be added if design file includes new file, the default searching steps are encouraged for unknown file type to improve robustness.

  Specified by:
    `findResource` in interface `IResourceLocator`
  Parameters:
    `moduleHandle` - The module to tell the search context. This could be null if the search algorithm does not need the design. It can be the instance of one of `ReportDesignHandle` and `LibraryHandle`.
    `fileName` - The file name to be searched. This could be an absolute path or a relative path.
    `type` - The type of the file to search. The value must be one of `IMAGE`,`LIBRARY` , `CASCADING_STYLE_SHEET` and `MESSAGEFILE`.
  Returns:
    The `URL` object. `null` if the file can not be found.

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

Copyright © 2008 Actuate Corp. All rights reserved.