Source:
public void run(IProgressMonitor monitor) throws IOException, OperationCanceledException { if (this.monitor != null) monitor = this.monitor; ZipFile zipFile = null; try { zipFile = new ZipFile(file); monitor.beginTask("Unpacking archive file to workspace", zipFile.size()); for (Enumeration<? extends ZipEntry> entries = zipFile.entries(); entries.hasMoreElements(); ) { final ZipEntry entry = entries.nextElement(); final String entryName = entry.getName(); if (monitor.isCanceled()) throw new OperationCanceledException(); final int delimiterIdx = entry.getName().indexOf(delimiter); if (delimiterIdx == -1) { LOG.warn("skipping zip entry " + entryName + ", entry is not valid"); monitor.worked(1); continue; } final String id = entryName.substring(0, delimiterIdx); final String path = entryName.substring(delimiterIdx + 1, entryName.length()); final IReferencePoint referencePoint = idToReferencePointMapping.get(id); if (referencePointManager == null) { LOG.warn("skipping zip entry " + entryName + ", unknown reference point id: " + id); monitor.worked(1); continue; } final IFile decompressedFile = referencePointManager.get(referencePoint).getFile(path); FileSystem.createFolder(decompressedFile); monitor.subTask("decompressing: " + path); final InputStream inZip = zipFile.getInputStream(entry); CancelableInputStream in; in = new CancelableInputStream(inZip, monitor); try { if (!decompressedFile.exists()) decompressedFile.create(in, false); else decompressedFile.setContents(in, false, true); } catch (IOException e) { if (monitor.isCanceled()) { throw new OperationCanceledException(); } else { throw e; } } monitor.worked(1); if (LOG.isTraceEnabled()) LOG.trace("file written to disk: " + path); } } finally { if (monitor != null) monitor.done(); try { if (zipFile != null) zipFile.close(); } catch (IOException e) { LOG.warn("failed to close zip file " + zipFile.getName() + " : " + e.getMessage()); } } }

Target:
public void run(IProgressMonitor monitor) throws IOException, OperationCanceledException { if (this.monitor != null) monitor = this.monitor; ZipFile zipFile = null; try { zipFile = new ZipFile(file); monitor.beginTask("Unpacking archive file to workspace", zipFile.size()); for (Enumeration<? extends ZipEntry> entries = zipFile.entries(); entries.hasMoreElements(); ) { final ZipEntry entry = entries.nextElement(); final String entryName = entry.getName(); if (monitor.isCanceled()) throw new OperationCanceledException(); final int delimiterIdx = entry.getName().indexOf(delimiter); if (delimiterIdx == -1) { LOG.warn("skipping zip entry " + entryName + ", entry is not valid"); monitor.worked(1); continue; } final String id = entryName.substring(0, delimiterIdx); final String path = entryName.substring(delimiterIdx + 1, entryName.length()); final IReferencePoint referencePoint = idToReferencePointMapping.get(id); if (referencePoint == null) { LOG.warn("skipping zip entry " + entryName + ", unknown reference point id: " + id); monitor.worked(1); continue; } final IFile decompressedFile = referencePointManager.get(referencePoint).getFile(path); FileSystem.createFolder(decompressedFile); monitor.subTask("decompressing: " + path); final InputStream inZip = zipFile.getInputStream(entry); CancelableInputStream in; in = new CancelableInputStream(inZip, monitor); try { if (!decompressedFile.exists()) decompressedFile.create(in, false); else decompressedFile.setContents(in, false, true); } catch (IOException e) { if (monitor.isCanceled()) { throw new OperationCanceledException(); } else { throw e; } } monitor.worked(1); if (LOG.isTraceEnabled()) LOG.trace("file written to disk: " + path); } } finally { if (monitor != null) monitor.done(); try { if (zipFile != null) zipFile.close(); } catch (IOException e) { LOG.warn("failed to close zip file " + zipFile.getName() + " : " + e.getMessage()); } } }