diff options
author | Decebal Suiu <decebal.suiu@gmail.com> | 2019-11-15 19:55:49 +0200 |
---|---|---|
committer | Decebal Suiu <decebal.suiu@gmail.com> | 2019-11-15 19:55:49 +0200 |
commit | 6d442e97d200b01a2546e61a01a6e530eb9e1cf2 (patch) | |
tree | dd7c4b8012abf6cc611cd2a04346600d32e38d56 | |
parent | 75dbeb0f94630be657758ad1fe5bdee81dc3f3d0 (diff) | |
download | pf4j-6d442e97d200b01a2546e61a01a6e530eb9e1cf2.tar.gz pf4j-6d442e97d200b01a2546e61a01a6e530eb9e1cf2.zip |
Small refactoring
4 files changed, 6 insertions, 4 deletions
diff --git a/pf4j/src/main/java/org/pf4j/LegacyExtensionFinder.java b/pf4j/src/main/java/org/pf4j/LegacyExtensionFinder.java index 33adc27..7c7ce09 100644 --- a/pf4j/src/main/java/org/pf4j/LegacyExtensionFinder.java +++ b/pf4j/src/main/java/org/pf4j/LegacyExtensionFinder.java @@ -15,6 +15,7 @@ */ package org.pf4j; +import org.pf4j.processor.ExtensionStorage; import org.pf4j.processor.LegacyExtensionStorage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -113,7 +114,7 @@ public class LegacyExtensionFinder extends AbstractExtensionFinder { private void collectExtensions(InputStream inputStream, Set<String> bucket) throws IOException { try (Reader reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8)) { - LegacyExtensionStorage.read(reader, bucket); + ExtensionStorage.read(reader, bucket); } } diff --git a/pf4j/src/main/java/org/pf4j/ServiceProviderExtensionFinder.java b/pf4j/src/main/java/org/pf4j/ServiceProviderExtensionFinder.java index 21f683c..48483fc 100644 --- a/pf4j/src/main/java/org/pf4j/ServiceProviderExtensionFinder.java +++ b/pf4j/src/main/java/org/pf4j/ServiceProviderExtensionFinder.java @@ -15,6 +15,7 @@ */ package org.pf4j; +import org.pf4j.processor.ExtensionStorage; import org.pf4j.processor.ServiceProviderExtensionStorage; import org.pf4j.util.FileUtils; import org.slf4j.Logger; @@ -139,7 +140,7 @@ public class ServiceProviderExtensionFinder extends AbstractExtensionFinder { public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { log.debug("Read '{}'", file); try (Reader reader = Files.newBufferedReader(file, StandardCharsets.UTF_8)) { - ServiceProviderExtensionStorage.read(reader, result); + ExtensionStorage.read(reader, result); } return FileVisitResult.CONTINUE; diff --git a/pf4j/src/main/java/org/pf4j/processor/LegacyExtensionStorage.java b/pf4j/src/main/java/org/pf4j/processor/LegacyExtensionStorage.java index 3abde8d..67bd2d6 100644 --- a/pf4j/src/main/java/org/pf4j/processor/LegacyExtensionStorage.java +++ b/pf4j/src/main/java/org/pf4j/processor/LegacyExtensionStorage.java @@ -48,7 +48,7 @@ public class LegacyExtensionStorage extends ExtensionStorage { FileObject file = getFiler().getResource(StandardLocation.CLASS_OUTPUT, "", EXTENSIONS_RESOURCE); // TODO try to calculate the extension point Set<String> entries = new HashSet<>(); - read(file.openReader(true), entries); + ExtensionStorage.read(file.openReader(true), entries); extensions.put(null, entries); } catch (FileNotFoundException | NoSuchFileException e) { // doesn't exist, ignore diff --git a/pf4j/src/main/java/org/pf4j/processor/ServiceProviderExtensionStorage.java b/pf4j/src/main/java/org/pf4j/processor/ServiceProviderExtensionStorage.java index e2bf397..6a3ec59 100644 --- a/pf4j/src/main/java/org/pf4j/processor/ServiceProviderExtensionStorage.java +++ b/pf4j/src/main/java/org/pf4j/processor/ServiceProviderExtensionStorage.java @@ -49,7 +49,7 @@ public class ServiceProviderExtensionStorage extends ExtensionStorage { FileObject file = getFiler().getResource(StandardLocation.CLASS_OUTPUT, "", EXTENSIONS_RESOURCE + "/" + extensionPoint); Set<String> entries = new HashSet<>(); - read(file.openReader(true), entries); + ExtensionStorage.read(file.openReader(true), entries); extensions.put(extensionPoint, entries); } catch (FileNotFoundException | NoSuchFileException e) { // doesn't exist, ignore |