private Properties loadEmbulkPropertiesFromFile(final Path embulkHome) {
        final Path path = embulkHome.resolve("embulk.properties");

        if (Files.notExists(path)) {
            logger.debug(path.toString() + " does not exist. Ignored.");
            return new Properties();
        }
        if (!Files.isRegularFile(path)) {
            logger.info(path.toString() + " exists, but not a regular file. Ignored.");
            return new Properties();
        }
        if (!Files.isReadable(path)) {
            logger.info(path.toString() + " exists, but not readable. Ignored.");
            return new Properties();
        }

        final Properties properties = new Properties();
        try (final InputStream input = Files.newInputStream(path, StandardOpenOption.READ)) {
            properties.load(input);
        } catch (final IOException ex) {
            logger.warn(path.toString() + " exists, but failed to load. Ignored.", ex);
            return new Properties();
        }
        return properties;
    }
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