All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jsoftware.command.PatchCommand Maven / Gradle / Ivy

package org.jsoftware.command;

import org.jsoftware.config.Patch;

import java.util.List;


/**
 * Runs auto-patch mode
 * @author szalik
 */
public class PatchCommand extends ListCommand implements CommandSuccessIndicator {
    private boolean success;
	
	@SuppressWarnings("unchecked")
	@Override
	protected void executeInternal() throws Exception {
		List patchesToApply = getList();
		success = false;
		try {
			manager.startExecution();
			for(Patch p : patchesToApply) {
				manager.apply(p);
			}
			success = true;
		} finally {
			manager.endExecution();
		}
	}


    @Override
    public boolean isSuccess() {
        return success;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy