squakez commented on code in PR #15063:
URL: https://github.com/apache/camel/pull/15063#discussion_r1711238528
##########
core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java:
##########
@@ -433,6 +448,43 @@ private Properties tryLoadProperties(
return ip;
}
+ private static Properties tryLoadCloudProperties(
+ Properties overridProperties, String cloudPropertiesLocations)
+ throws IOException {
+
+ final Properties cp = new Properties();
+ try {
+ String[] locations = cloudPropertiesLocations.split(",");
+ for (String loc : locations) {
+ Path confPath = Paths.get(loc);
+ if (Files.exists(confPath) && Files.isDirectory(confPath)) {
+ Files.walkFileTree(confPath, new SimpleFileVisitor<Path>()
{
+ @Override
+ public FileVisitResult visitFile(Path file,
BasicFileAttributes attrs) {
+ if (!Files.isDirectory(file)) {
+ try {
+ String val = new
String(Files.readAllBytes(file));
+ cp.put(file.getFileName().toString(), val);
+ } catch (IOException e) {
+ // Do nothing or should we throw a
RuntimeException?
+ }
+ }
+ return FileVisitResult.CONTINUE;
+ }
+ });
+ }
+ }
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ if (overridProperties == null) {
+ return cp;
+ }
+ Properties mergedProperties = new Properties(overridProperties);
Review Comment:
I'll have a look at this then, thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]