@Override protected byte[] notFound(ModuleItem contentItem) throws IOException { // Maybe just don't record the original ADD as part of the history? if (description.getModificationType() == ModificationType.REMOVE) { return contentItem.getContentHash(); } return super.notFound(contentItem); }
@Override protected byte[] notFound(ModuleItem contentItem) throws IOException { // Maybe just don't record the original ADD as part of the history? if (description.getModificationType() == ModificationType.REMOVE) { return contentItem.getContentHash(); } return super.notFound(contentItem); }
static PatchingTask createModuleTask(final PatchingTaskDescription description, boolean rollback) { if (rollback) { return new ModuleRollbackTask(description); } else { final ModificationType type = description.getModificationType(); if(type == ModificationType.REMOVE) { return new ModuleRemoveTask(description); } else { return new ModuleUpdateTask(description); } } }
static PatchingTask createModuleTask(final PatchingTaskDescription description, boolean rollback) { if (rollback) { return new ModuleRollbackTask(description); } else { final ModificationType type = description.getModificationType(); if(type == ModificationType.REMOVE) { return new ModuleRemoveTask(description); } else { return new ModuleUpdateTask(description); } } }
static PatchingTask createMiscTask(final PatchingTaskDescription description, final MiscContentItem item, final PatchingTaskContext context) { // Create the task final File target = context.getTargetFile(item); final File backup = context.getBackupFile(item); final ModificationType type = description.getModificationType(); switch (type) { case ADD: case MODIFY: return new FileUpdateTask(description, target, backup); case REMOVE: return new FileRemoveTask(description, target, backup); default: throw new IllegalStateException(); } } }
static PatchingTask createMiscTask(final PatchingTaskDescription description, final MiscContentItem item, final PatchingTaskContext context) { // Create the task final File target = context.getTargetFile(item); final File backup = context.getBackupFile(item); final ModificationType type = description.getModificationType(); switch (type) { case ADD: case MODIFY: return new FileUpdateTask(description, target, backup); case REMOVE: return new FileRemoveTask(description, target, backup); default: throw new IllegalStateException(); } } }