Class PropertyFileScanner

java.lang.Object
com.patbaumgartner.spring.migrator.core.PropertyFileScanner

public final class PropertyFileScanner extends Object
Finds the configuration files a migration should look at.

Rather than walking the whole project and filtering afterwards, the scanner derives the directories it needs to visit from the literal prefix of each include pattern. A default run therefore touches only src/main/resources and src/test/resources instead of descending into .git, target or node_modules.

  • Method Details

    • scan

      public static PropertyFileScanner.ScanResult scan(Path rootDir, List<String> includes)
      Scans a project for files matching the given glob patterns.
      Parameters:
      rootDir - the project root that patterns are relative to
      includes - glob patterns relative to the project root
      Returns:
      the matching files and any directories that could not be read
    • defaultIncludes

      public static List<String> defaultIncludes()
      Returns the default patterns, covering Spring Boot's conventional configuration file locations for main and test resources.
      Returns:
      the default include patterns