private List<Path> findSubdirectories(
            final Path embulkHome,
            final Properties embulkPropertiesFromFile,
            final String propertyName,
            final String envName) {
        // 1) If a system config <propertyName> is set from the command line, it is the most prioritized.
        final List<Path> ofCommandLine = normalizePathsInCommandLineProperties(propertyName, true);
        if (!ofCommandLine.isEmpty()) {
            logger.info(
                    "{} is set from command-line: {}",
                    propertyName,
                    ofCommandLine.stream().map(path -> path.toString()).collect(Collectors.joining(File.pathSeparator)));
            return ofCommandLine;
        }

        // 2) If a system config <propertyName> is set from "embulk.properties", it is the second prioritized.
        final List<Path> ofEmbulkPropertiesFile =
                normalizePathsInEmbulkPropertiesFile(propertyName, embulkPropertiesFromFile, embulkHome, true);
        if (!ofEmbulkPropertiesFile.isEmpty()) {
            logger.info(
                    "{} is set from embulk.properties: {}",
                    propertyName,
                    ofEmbulkPropertiesFile.stream().map(path -> path.toString()).collect(Collectors.joining(File.pathSeparator)));
            return ofEmbulkPropertiesFile;
        }

        // 3) If an environment variable <envName> is set, it is the third prioritized.
        final List<Path> ofEnv = normalizePathsInEnv(envName, true);
        if (!ofEnv.isEmpty()) {
            logger.info(
                    "{} is set from environment variable \"{}\": {}",
                    propertyName,
                    envName,
                    ofEnv.stream().map(path -> path.toString()).collect(Collectors.joining(File.pathSeparator)));
            return ofEnv;
        }

        // 4) If none of the above does not match, return an empty list.
        logger.info("{} is set empty.", propertyName);
        return Collections.unmodifiableList(new ArrayList<>());
    }
Finds an appropriate "embulk_home" directory based on a rule defined.

<ul>
<li>1) If a system config {@code "embulk_home"} is set from the command line, it is the most prioritized.
<li>2) If an environment variable {@code "EMBULK_HOME"} is set, it is the second prioritized.
<li>3) If neither (1) nor (2) is set, it iterates up over parent directories from "user.dir" for a directory that:
  <ul>
  <li>is named ".embulk",
  <li>has "embulk.properties" just under itself.
  </ul>
  <ul>
  <li>3-1) If "user.dir" (almost equal to the working directory) is under "user.home", it iterates up till "user.home".
  <li>3-2) If "user.dir" is not under "user.home", Embulk iterates until the root directory.
  </ul>
</li>
<li>4) If none of the above does not work, use the traditional predefined directory "~/.embulk".
</ul>
embulk-core/src/main/java/org/embulk/cli/EmbulkSystemPropertiesBuilder.java