DirectoryModelFinder (Apache OpenNLP :: Core :: Model Resolver 3.0.0-M4 API)
Description: declaration: package: opennlp.tools.models.dir, class: DirectoryModelFinder

Package opennlp.tools.models.dir

# Class DirectoryModelFinder

java.lang.Object
opennlp.tools.models.AbstractClassPathModelFinder
opennlp.tools.models.dir.DirectoryModelFinder

All Implemented Interfaces:
  `opennlp.tools.models.ClassPathModelFinder`

public class DirectoryModelFinder extends AbstractClassPathModelFinder implements opennlp.tools.models.ClassPathModelFinder
The `DirectoryModelFinder` class is responsible for finding model files in a given directory on the classpath.

This class allows searching for models based on wildcard patterns, either in plain directory structures or within JAR files. The search can be performed recursively depending on the specified configuration.

Usage:

- Provide the prefix for models to be found in JAR files using the `jarModelPrefix` parameter.
- Specify the directory to search and whether to enable recursive scanning.
- The class supports resolving both direct file matches and entries within JAR archives.

See Also:
  - `AbstractClassPathModelFinder`
  - `ClassPathModelFinder`

- ## Field Summary

  ### Fields inherited from interface opennlp.tools.models.ClassPathModelFinder

  `OPENNLP_MODEL_JAR_PREFIX`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DirectoryModelFinder(String jarModelPrefix, Path directory, boolean recursive)`
  Instantiates a new `DirectoryModelFinder` with the specified parameters.

- ## Method Summary

  ### Methods inherited from class opennlp.tools.models.AbstractClassPathModelFinder

  `findModels`

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

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

  ### Methods inherited from interface opennlp.tools.models.ClassPathModelFinder

  `findModels`

- ## Constructor Details

  - ### DirectoryModelFinder

    public DirectoryModelFinder(String jarModelPrefix, Path directory, boolean recursive)
    Instantiates a new `DirectoryModelFinder` with the specified parameters.
    Parameters:
      `jarModelPrefix` - The prefix for identifying model files in JAR archives; may be `null`. If it is `null`, `ClassPathModelFinder.OPENNLP_MODEL_JAR_PREFIX` is used.
      `directory` - The root directory to scan from for model files; must not be `null`.
      `recursive` - `true` if the search should include subdirectories, `false` otherwise.
    Throws:
      `IllegalArgumentException` - Thrown if `directory` is `null`.