static PatchingTaskDescription create(final PatchingTasks.ContentTaskDefinition definition, final PatchContentLoader loader) { final ContentModification modification = resolveDefinition(definition); // Check if we already have the new content final ContentItem item = definition.getTarget().getItem(); final byte[] currentHash = definition.getLatest().getTargetHash(); final byte[] newContentHash = item.getContentHash(); boolean skipIfExists = Arrays.equals(currentHash, newContentHash); return new PatchingTaskDescription(definition.getTarget().getPatchId(), modification, loader, definition.hasConflicts(), skipIfExists, definition.isRollback()); }
static PatchingTaskDescription create(final PatchingTasks.ContentTaskDefinition definition, final PatchContentLoader loader) { final ContentModification modification = resolveDefinition(definition); // Check if we already have the new content final ContentItem item = definition.getTarget().getItem(); final byte[] currentHash = definition.getLatest().getTargetHash(); final byte[] newContentHash = item.getContentHash(); boolean skipIfExists = Arrays.equals(currentHash, newContentHash); return new PatchingTaskDescription(definition.getTarget().getPatchId(), modification, loader, definition.hasConflicts(), skipIfExists, definition.isRollback()); }
/** * Create the patching task based on the definition. * * @param definition the task description * @param provider the content provider * @param context the task context * @return the created task */ static PatchingTask createTask(final PatchingTasks.ContentTaskDefinition definition, final PatchContentProvider provider, final IdentityPatchContext.PatchEntry context) { final PatchContentLoader contentLoader = provider.getLoader(definition.getTarget().getPatchId()); final PatchingTaskDescription description = PatchingTaskDescription.create(definition, contentLoader); return PatchingTask.Factory.create(description, context); }
/** * Create the patching task based on the definition. * * @param definition the task description * @param provider the content provider * @param context the task context * @return the created task */ static PatchingTask createTask(final PatchingTasks.ContentTaskDefinition definition, final PatchContentProvider provider, final IdentityPatchContext.PatchEntry context) { final PatchContentLoader contentLoader = provider.getLoader(definition.getTarget().getPatchId()); final PatchingTaskDescription description = PatchingTaskDescription.create(definition, contentLoader); return PatchingTask.Factory.create(description, context); }