ZipPackage(String path, PackageAccess access) {
super(access);
- ZipFile zipFile = ZipHelper.openZipFile(path);
- if (zipFile == null)
- throw new InvalidOperationException(
- "Can't open the specified file: '" + path + "'");
+ ZipFile zipFile = null;
+
+ try {
+ zipFile = ZipHelper.openZipFile(path);
+ } catch (IOException e) {
+ throw new InvalidOperationException(
+ "Can't open the specified file: '" + path + "'", e);
+ }
+
this.zipArchive = new ZipFileZipEntrySource(zipFile);
}
* The file path.
* @return The zip archive freshly open.
*/
- public static ZipFile openZipFile(String path) {
+ public static ZipFile openZipFile(String path) throws IOException {
File f = new File(path);
- try {
- if (!f.exists()) {
- return null;
- }
- return new ZipFile(f);
- } catch (IOException ioe) {
+
+ if (!f.exists()) {
return null;
}
+
+ return new ZipFile(f);
}
}