Skip to content

Commit

Permalink
Fixed IConfig interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
mwever committed Jul 11, 2019
1 parent 11054a4 commit 8225ff5
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions common/src/main/java/org/api4/java/common/control/IConfig.java
Expand Up @@ -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);
Expand Down Expand Up @@ -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.