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.apache.cayenne.resource
Class FilesystemResourceLocator

    java.lang.Object
      org.apache.cayenne.resource.FilesystemResourceLocator

All Implemented Interfaces:
  ResourceLocator

    public class FilesystemResourceLocator

extends java.lang.Object
implements ResourceLocator

A `ResourceLocator` that can locate resources in the filesystem. Instances of `FilesystemResourceLocator` are explicitly created by the user and then bound to a DI registry. E.g.:

     class MyModule implements Module {

         public void configure(Binder binder) {
            File dir1 = ...
            File dir2 = ...
            binder.bind(ResourceLocator.class).
               toInstance(new FilesystemResourceLocator(dir1, dir2);
         }

Since:
  3.1

Field Summary
`protected java.io.File[]` | `roots`

Constructor Summary
`FilesystemResourceLocator(java.util.Collection<java.io.File> roots)` Creates a new `FilesystemResourceLocator`, using a collection of base locations.
`FilesystemResourceLocator(java.io.File... roots)` Creates a new `FilesystemResourceLocator`, using an array of base locations ("roots").

Method Summary
`java.util.Collection<Resource>` | `findResources(java.lang.String name)` Finds a collection of matching resources for a given name.

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

Field Detail

### roots

    protected java.io.File[] roots

Constructor Detail

### FilesystemResourceLocator

    public FilesystemResourceLocator(java.io.File... roots)

  Creates a new `FilesystemResourceLocator`, using an array of base locations ("roots"). If a location is a file, its parent directory is used for resolving. If location is a directory, it is used as is. If no locations are specified, current application directory is used as a single base.

### FilesystemResourceLocator

    public FilesystemResourceLocator(java.util.Collection<java.io.File> roots)

  Creates a new `FilesystemResourceLocator`, using a collection of base locations. If a location is a file, its parent directory is used for resolving. If location is a directory, it is used as is. If no locations are specified, current application directory is used as a single base.

Method Detail

### findResources

    public java.util.Collection<Resource> findResources(java.lang.String name)

  Description copied from interface: `ResourceLocator`
  Finds a collection of matching resources for a given name. The name components must be separated by forward slashes.

  Specified by:
    `findResources` in interface `ResourceLocator`

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 © 2001-2011 Apache Cayenne. All Rights Reserved.