@Override public void close() throws IOException { if(zipArchive != null) { zipArchive.close(); } zipArchive = null; }
/** * Ensures that the close method of this zipfile is called when * there are no more references to it. * @see #close() */ @Override protected void finalize() throws Throwable { try { if (!closed) { System.err.println("Cleaning up unclosed ZipFile for archive " + archiveName); close(); } } finally { super.finalize(); } }
@Override public void close() throws IOException { if(!closed) { zipFile.close(); if (!tmpFile.delete()) { LOG.log(POILogger.WARN, tmpFile.getAbsolutePath()+" can't be removed (or was already removed."); } } closed = true; }
zf.close(); } catch (IOException exc) { exc.printStackTrace();
@Override public void close() throws IOException { zipFile.close(); }
@Override public void close() throws IOException { try { urlClassLoader.close(); } finally { try { zipFile.close(); } finally { jarFile.close(); } } }
protected String readArchiveText(InputStream inputStream) throws IOException { Path tempFile = writeTemporaryArchiveFile(inputStream, "zip"); ZipFile zip = new ZipFile(tempFile.toFile()); zip.getEntry(UnpackerResource.TEXT_FILENAME); ByteArrayOutputStream bos = new ByteArrayOutputStream(); IOUtils.copy(zip.getInputStream(zip.getEntry(UnpackerResource.TEXT_FILENAME)), bos); zip.close(); Files.delete(tempFile); return bos.toString(UTF_8.name()); }
protected Map<String, String> readZipArchive(InputStream inputStream) throws IOException { Map<String, String> data = new HashMap<String, String>(); Path tempFile = writeTemporaryArchiveFile(inputStream, "zip"); ZipFile zip = new ZipFile(tempFile.toFile()); Enumeration<ZipArchiveEntry> entries = zip.getEntries(); while (entries.hasMoreElements()) { ZipArchiveEntry entry = entries.nextElement(); ByteArrayOutputStream bos = new ByteArrayOutputStream(); IOUtils.copy(zip.getInputStream(entry), bos); data.put(entry.getName(), DigestUtils.md5Hex(bos.toByteArray())); } zip.close(); Files.delete(tempFile); return data; }
@Override protected void finalize() throws Throwable { super.close(); } };
@Override public void close() throws IOException { this.zf.close(); } }
private void closeFile() { try { file.close(); } catch (IOException e) { // close quietly } }
private void closeFile() { try { file.close(); } catch (IOException e) { // close quietly } }
@Override public void close() throws IOException { zipFile.close(); }
@Override public void close() throws IOException { this.zipFile.close(); }
zipFile.close(); zipFile = null;
@Override public void close() throws IOException { super.close(); file.close(); } };
zf.close(); zf = null;
zip.close(); } catch (IOException e) {
@Override public void close() throws IOException { FileUtils.close(in); z.close(); } @Override