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(); } } }