Package io.vertx.config.spi.utils

## Class FileSet

- java.lang.Object
- - io.vertx.config.spi.utils.FileSet

-     public class FileSet
      extends Object

  Utility class to manage file set selected using a pattern.
  Author:
    Clement Escoffier

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `FileSet​(Vertx vertx, File root, JsonObject set)` | Creates a new `FileSet` from a json object.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `buildConfiguration​(List<File> files, Handler<AsyncResult<JsonObject>> handler)` | Iterates over the given set of files, and for each matching file, computes the resulting configuration.
    `static boolean` | `match​(String pattern, String str, boolean isCaseSensitive)` | Tests whether or not a string matches against a pattern.
    `static List<File>` | `traverse​(File root)` | List all the files from a directory (recursive)

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

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

- - ### Constructor Detail

    - #### FileSet

          public FileSet​(Vertx vertx,
                         File root,
                         JsonObject set)

      Creates a new `FileSet` from a json object.
      Parameters:
        `vertx` - the Vert.x instance
        `root` - the root of the fileset (directory)
        `set` - the configuration

  - ### Method Detail

    - #### match

          public static boolean match​(String pattern,
                                      String str,
                                      boolean isCaseSensitive)

      Tests whether or not a string matches against a pattern. The pattern may contain two special characters:
      '*' means zero or more characters
      '?' means one and only one character
      Parameters:
        `pattern` - The pattern to match against. Must not be`null`.
        `str` - The string which must be matched against the pattern. Must not be`null`.
        `isCaseSensitive` - Whether or not matching should be performed case sensitively.
      Returns:
        `true` if the string matches against the pattern, or `false` otherwise.

    - #### buildConfiguration

          public void buildConfiguration​(List<File> files,
                                         Handler<AsyncResult<JsonObject>> handler)

      Iterates over the given set of files, and for each matching file, computes the resulting configuration. The given handler is called with the merged configuration (containing the configuration obtained by merging the configuration from all matching files).
      Parameters:
        `files` - the list of files
        `handler` - the handler called with the computed configuration

    - #### traverse

          public static List<File> traverse​(File root)

      List all the files from a directory (recursive)
      Parameters:
        `root` - the root
      Returns:
        the list of files