Skip to content

Commit

Permalink
Fixed config locations to be URIs
Browse files Browse the repository at this point in the history
(cherry picked from commit 52cb1cd)
  • Loading branch information
Mike Weber authored and gsmet committed Jan 8, 2022
1 parent 30b8767 commit d56247c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.lang.reflect.Modifier;
import java.net.URI;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collections;
Expand Down Expand Up @@ -253,12 +255,13 @@ public void watchConfigFiles(BuildProducer<HotDeploymentWatchedFileBuildItem> wa
configWatchedFiles.add(
Paths.get(userDir, "config", String.format("application-%s.properties", profile)).toAbsolutePath().toString());

Optional<List<String>> optionalLocations = config.getOptionalValues(SMALLRYE_CONFIG_LOCATIONS, String.class);
Optional<List<URI>> optionalLocations = config.getOptionalValues(SMALLRYE_CONFIG_LOCATIONS, URI.class);
optionalLocations.ifPresent(locations -> {
for (String location : locations) {
if (!Files.isDirectory(Paths.get(location))) {
configWatchedFiles.add(location);
configWatchedFiles.add(appendProfileToFilename(location, profile));
for (URI location : locations) {
Path path = location.getScheme() != null ? Paths.get(location) : Paths.get(location.getPath());
if (!Files.isDirectory(path)) {
configWatchedFiles.add(location.toString());
configWatchedFiles.add(appendProfileToFilename(location.toString(), profile));
}
}
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.quarkus.runtime;

import java.net.URI;
import java.util.List;
import java.util.Optional;

Expand All @@ -21,7 +22,7 @@ public class ConfigConfig {
* separated by a comma and each must represent a valid {@link java.net.URI}.
*/
@ConfigItem(name = "config.locations")
public Optional<List<String>> locations;
public Optional<List<URI>> locations;

/**
* Accepts a single configuration profile name. If a configuration property cannot be found in the current active
Expand Down

0 comments on commit d56247c

Please sign in to comment.