Skip to content

Commit

Permalink
Fixed config locations to be URIs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Weber authored and gsmet committed Jan 6, 2022
1 parent 37918d0 commit 0ee58de
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
import static java.util.stream.Collectors.toSet;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Modifier;
import java.nio.file.Files;
import java.net.URI;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collections;
Expand Down Expand Up @@ -253,12 +254,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) {
File file = new File(location);
if (!file.isDirectory()) {
configWatchedFiles.add(file.getAbsolutePath());
configWatchedFiles.add(appendProfileToFilename(file.getAbsolutePath(), profile));
}
}
});
Expand Down

0 comments on commit 0ee58de

Please sign in to comment.