@Override public File[] getTargetModulePath() { // We need the updated state for invalidating one-off patches // When applying the overlay directory should not exist yet final PatchableTarget.TargetInfo updated = mode == Mode.APPLY ? delegate : delegate.getModifiedState(); return PatchUtils.getModulePath(delegate.getDirectoryStructure(), updated); }
@Override public void rollback(String patchId) { rollbacks.add(patchId); // Rollback delegate.rollback(patchId); // Record rollback loader recordRollbackLoader(patchId, delegate); }
@Override public File getTargetFile(ContentItem item) { if (item.getContentType() == ContentType.MISC) { return IdentityPatchContext.this.getTargetFile((MiscContentItem) item); } if (applyPatchId == null || state == State.ROLLBACK_ONLY) { throw new IllegalStateException( "cannot process rollback tasks for modules/bundles"); // internal wrong usage, no i18n } final File root; final DirectoryStructure structure = delegate.getDirectoryStructure(); if (item.getContentType() == ContentType.BUNDLE) { root = structure.getBundlesPatchDirectory(applyPatchId); } else { root = structure.getModulePatchDirectory(applyPatchId); } return PatchContentLoader.getModulePath(root, (ModuleItem) item); }
@Override public PatchableTarget.TargetInfo getModifiedState() { return delegate.getModifiedState(); }
@Override public DirectoryStructure getDirectoryStructure() { return delegate.getDirectoryStructure(); }
@Override public Properties getProperties() { return delegate.getProperties(); }
@Override public List<String> getPatchIDs() { return delegate.getPatchIDs(); }
@Override public String getCumulativePatchID() { return delegate.getCumulativePatchID(); }
@Override public void apply(String patchId, Patch.PatchType patchType) { delegate.apply(patchId, patchType); applyPatchId = patchId; }
@Override public boolean isApplied(String patchId) { return delegate.isApplied(patchId); }