-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding simple ConfigFilesProvider impl.
- Loading branch information
pcummuskey
committed
Nov 9, 2017
1 parent
3a5daef
commit e472353
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
...-core/src/main/java/org/cfg4j/source/context/filesprovider/SimpleConfigFilesProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.cfg4j.source.context.filesprovider; | ||
|
||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* A simple provider implementation that | ||
*/ | ||
public class SimpleConfigFilesProvider implements ConfigFilesProvider { | ||
|
||
private final List<Path> paths; | ||
|
||
SimpleConfigFilesProvider(String... files) { | ||
paths = new ArrayList<>(files.length); | ||
for (String file : files) { | ||
paths.add(Paths.get(file)); | ||
} | ||
} | ||
|
||
@Override | ||
public Iterable<Path> getConfigFiles() { | ||
return paths; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "SimpleConfigFilesProvider{" + | ||
"paths=" + paths + | ||
'}'; | ||
} | ||
|
||
} |