Skip to content
Permalink
Browse files

Fixed IConfig interface.

  • Loading branch information...
mwever committed Jul 11, 2019
1 parent 11054a4 commit 8225ff5d0cfb43de15e2957f65e122dbd5d6eda4
Showing with 3 additions and 15 deletions.
  1. +3 −15 common/src/main/java/org/api4/java/common/control/IConfig.java
@@ -42,7 +42,7 @@ default IConfig loadPropertiesFromFile(final File file) {
*/
default IConfig loadPropertiesFromResource(final String resourcePath) throws IOException {
// Get file from resources folder
ClassLoader classLoader = FileUtil.class.getClassLoader();
ClassLoader classLoader = this.getClass().getClassLoader();
String content = null;
try (InputStream inputStream = classLoader.getResourceAsStream(resourcePath)) {
ByteArrayOutputStream result = new ByteArrayOutputStream(1024);
@@ -76,18 +76,6 @@ default IConfig loadPropertiesFromList(final List<String> propertiesList) {
return this;
}

/**
* Reads the content of the given file as a list of strings.
*
* @param file The file to be read.
* @return The list of strings representing the content of the file.
* @throws IOException Thrown, if there are issues reading the file.
*/
public static List<String> readFileAsList(final File file) throws IOException {
if (file instanceof ResourceFile) {
return ResourceUtil.readResourceFileToStringList((ResourceFile) file);
} else {
return readFileAsList(file.getAbsolutePath());
}
}
public String setProperty(String key, String value);

}

0 comments on commit 8225ff5

Please sign in to comment.
You can’t perform that action at this time.