summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDecebal Suiu <decebal.suiu@gmail.com>2018-02-03 00:16:00 +0200
committerDecebal Suiu <decebal.suiu@gmail.com>2018-02-03 00:16:00 +0200
commit235896b5c1c63509189edd6fe5d511278ccdea1b (patch)
tree1cd741a1f7fa963db1ef3ef39f43c58889acdc73
parentc4e5635212aef4a01a81006405dcb0cf5d4920a2 (diff)
downloadpf4j-235896b5c1c63509189edd6fe5d511278ccdea1b.tar.gz
pf4j-235896b5c1c63509189edd6fe5d511278ccdea1b.zip
Resolve #200
-rw-r--r--pf4j/src/main/java/org/pf4j/processor/LegacyExtensionStorage.java5
-rw-r--r--pf4j/src/main/java/org/pf4j/processor/ServiceProviderExtensionStorage.java3
2 files changed, 5 insertions, 3 deletions
diff --git a/pf4j/src/main/java/org/pf4j/processor/LegacyExtensionStorage.java b/pf4j/src/main/java/org/pf4j/processor/LegacyExtensionStorage.java
index d664e4e..9adfd66 100644
--- a/pf4j/src/main/java/org/pf4j/processor/LegacyExtensionStorage.java
+++ b/pf4j/src/main/java/org/pf4j/processor/LegacyExtensionStorage.java
@@ -23,6 +23,7 @@ import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.Reader;
+import java.nio.file.NoSuchFileException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@@ -68,8 +69,8 @@ public class LegacyExtensionStorage extends ExtensionStorage {
Set<String> entries = new HashSet<>();
read(file.openReader(true), entries);
extensions.put(null, entries);
- } catch (FileNotFoundException e) {
- // ignore
+ } catch (FileNotFoundException | NoSuchFileException e) {
+ // doesn't exist, ignore
} catch (FilerException e) {
// re-opening the file for reading or after writing is ignorable
} catch (IOException e) {
diff --git a/pf4j/src/main/java/org/pf4j/processor/ServiceProviderExtensionStorage.java b/pf4j/src/main/java/org/pf4j/processor/ServiceProviderExtensionStorage.java
index 135063f..65c9a2c 100644
--- a/pf4j/src/main/java/org/pf4j/processor/ServiceProviderExtensionStorage.java
+++ b/pf4j/src/main/java/org/pf4j/processor/ServiceProviderExtensionStorage.java
@@ -23,6 +23,7 @@ import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.Reader;
+import java.nio.file.NoSuchFileException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@@ -69,7 +70,7 @@ public class ServiceProviderExtensionStorage extends ExtensionStorage {
Set<String> entries = new HashSet<>();
read(file.openReader(true), entries);
extensions.put(extensionPoint, entries);
- } catch (FileNotFoundException e) {
+ } catch (FileNotFoundException | NoSuchFileException e) {
// doesn't exist, ignore
} catch (FilerException e) {
// re-opening the file for reading or after writing is ignorable