Skip to content

Commit

Permalink
Added another overload to accept Path items as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
pcummuskey committed Feb 28, 2018
1 parent d6c09ef commit bae1d16
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
Expand All @@ -19,6 +20,10 @@ public SimpleConfigFilesProvider(String... files) {
}
}

public SimpleConfigFilesProvider(Path... paths) {
this.paths = Arrays.asList(paths);
}

@Override
public Iterable<Path> getConfigFiles() {
return paths;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ public FilesConfigurationSource(String... paths) {
this(new SimpleConfigFilesProvider(paths));
}

/**
* Construct {@link ConfigurationSource} backed by files. Uses the provided paths to locate the needed files within
* the {@link Environment} provided to {@link #getConfiguration(Environment)} calls (see corresponding javadoc for
* detail).
* @param paths The paths to read from.
*/
public FilesConfigurationSource(Path... paths) {
this(new SimpleConfigFilesProvider(paths));
}

/**
* Construct {@link ConfigurationSource} backed by files. File paths should by provided by
* {@link ConfigFilesProvider} and will be treated as relative paths to the environment provided in
Expand Down

0 comments on commit bae1d16

Please sign in to comment.