/** * Unpack a zip file to a given directory. Honor the paths as given in the * zip file. * * @param file * The zip file to download * @param destdir * The directory to unpack up * @throws IOException * If there is an file error */ public static void unpackZip(File file, File destdir) throws IOException { unpackZip(file, destdir, true); }
public void installDownloadedIndex(Book book, URI tempDest) throws BookException { try { URI storage = getStorageArea(book); File zip = NetUtil.getAsFile(tempDest); IOUtil.unpackZip(zip, NetUtil.getAsFile(storage)); //todo Index.Version management?? } catch (IOException ex) { // TRANSLATOR: The search index could not be moved to it's final location. throw new BookException(JSMsg.gettext("Installation failed."), ex); } }