Alon Bar-Lev has uploaded a new change for review. Change subject: utils: tar: throw an exception if base does not exist ......................................................................
utils: tar: throw an exception if base does not exist Change-Id: I25e4e41f7c68c9a6b797b7436c8565d2ad059329 Signed-off-by: Alon Bar-Lev <[email protected]> --- M backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/hostinstall/Tar.java 1 file changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/65/9165/1 diff --git a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/hostinstall/Tar.java b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/hostinstall/Tar.java index 4f1f30e..ffa423e 100644 --- a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/hostinstall/Tar.java +++ b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/hostinstall/Tar.java @@ -3,6 +3,7 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; +import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -91,6 +92,16 @@ OutputStream os, File base ) throws SecurityException, IOException { + + if (!base.exists()) { + throw new FileNotFoundException( + String.format( + "File or directory %1$s not found", + base + ) + ); + } + TarArchiveOutputStream archive = null; try { archive = new TarArchiveOutputStream(os); -- To view, visit http://gerrit.ovirt.org/9165 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I25e4e41f7c68c9a6b797b7436c8565d2ad059329 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
