Skip to content

Commit

Permalink
Adding simple ConfigFilesProvider impl.
Browse files Browse the repository at this point in the history
  • Loading branch information
pcummuskey committed Nov 9, 2017
1 parent 3a5daef commit e472353
Showing 1 changed file with 34 additions and 0 deletions.
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 +
'}';
}

}

0 comments on commit e472353

Please sign in to comment.