Package org.apache.cayenne.resource

# Class FilesystemResourceLocator

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

All Implemented Interfaces:
  `ResourceLocator`

@Deprecated public class FilesystemResourceLocator extends Object implements ResourceLocator
Deprecated.
since 4.1. This can be implemented as a custom strategy outside Cayenne. There's no need for this object to be in Cayenne.
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

  Fields
  Modifier and Type
  Field
  Description
  `protected File[]`
  `roots`
  Deprecated.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FilesystemResourceLocator(File... roots)`
  Deprecated.
  Creates a new `FilesystemResourceLocator`, using an array of base locations ("roots").
  `FilesystemResourceLocator(Collection<File> roots)`
  Deprecated.
  Creates a new `FilesystemResourceLocator`, using a collection of base locations.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Collection<Resource>`
  `findResources(String name)`
  Deprecated.
  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 Details

  - ### roots

    protected File[] roots
    Deprecated.

- ## Constructor Details

  - ### FilesystemResourceLocator

    public FilesystemResourceLocator(File... roots)
    Deprecated.
    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(Collection<File> roots)
    Deprecated.
    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 Details

  - ### findResources

    public Collection<Resource> findResources(String name)
    Deprecated.
    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`