public static Map loadApplicationProperties()

in camel-k-core/support/src/main/java/org/apache/camel/k/support/RuntimeSupport.java [261:283]


    public static Map<String, String> loadApplicationProperties() {
        final String conf = System.getProperty(Constants.PROPERTY_CAMEL_K_CONF, System.getenv(Constants.ENV_CAMEL_K_CONF));
        final Map<String, String> properties = new HashMap<>();

        if (ObjectHelper.isEmpty(conf)) {
            return properties;
        }

        try {
            Path confPath = Paths.get(conf);
            if (Files.exists(confPath) && !Files.isDirectory(confPath)) {
                try (Reader reader = Files.newBufferedReader(confPath)) {
                    Properties p = new Properties();
                    p.load(reader);
                    p.forEach((key, value) -> properties.put(String.valueOf(key), String.valueOf(value)));
                }
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

        return properties;
    }