From caa2340653621014a5b32db3b2a19cc372854874 Mon Sep 17 00:00:00 2001 From: Daniel Scalzi Date: Sun, 15 Jul 2018 16:20:02 -0400 Subject: [PATCH] Check for AccessDeniedException in Jar provider. --- .../com/dscalzi/zipextractor/providers/JarProvider.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/dscalzi/zipextractor/providers/JarProvider.java b/src/main/java/com/dscalzi/zipextractor/providers/JarProvider.java index dd81ed6..cbd77f4 100644 --- a/src/main/java/com/dscalzi/zipextractor/providers/JarProvider.java +++ b/src/main/java/com/dscalzi/zipextractor/providers/JarProvider.java @@ -7,9 +7,9 @@ import java.io.File; import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; +import java.nio.file.AccessDeniedException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -97,8 +97,8 @@ public void extract(CommandSender sender, File src, File dest) { } jis.closeEntry(); mm.extractionComplete(sender, dest.getAbsolutePath()); - } catch (FileNotFoundException e) { - mm.fileNotFound(sender, src.getAbsolutePath()); + } catch (AccessDeniedException e) { + mm.fileAccessDenied(sender, ZTask.EXTRACT, e.getMessage()); } catch (TaskInterruptedException e) { mm.taskInterruption(sender, ZTask.EXTRACT); } catch (IOException e) {