// Path: dbpatch-core/src/main/java/org/jsoftware/dbpatch/config/AbstractPatch.java
// public abstract class AbstractPatch implements Serializable {
//     private static final long serialVersionUID = 4178101927323891639L;
//     private String name;
//     private int statementCount = -1;
//     private File file;
// 
//     public enum DbState {
//         COMMITTED, IN_PROGRESS, NOT_AVAILABLE
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public int getStatementCount() {
//         return statementCount;
//     }
// 
//     public void setStatementCount(int statementCount) {
//         this.statementCount = statementCount;
//     }
// 
//     public File getFile() {
//         return file;
//     }
// 
//     public void setFile(File file) {
//         this.file = file;
//     }
// 
//     public abstract void setDbDate(Date dbDate);
// 
//     public abstract void setDbState(DbState dbState);
// 
//     public abstract Date getDbDate();
// 
//     public abstract DbState getDbState();
// 
//     public abstract boolean canApply();
// 
//     public String toString() {
//         return super.toString() + "-" + name;
//     }
// 
//     public static String normalizeName(String name) {
//         String nameLC = name.toLowerCase();
//         while (nameLC.endsWith(".sql") || nameLC.endsWith(".undo") || nameLC.endsWith(".rollback")) {
//             int dot = nameLC.lastIndexOf('.');
//             nameLC = nameLC.substring(0, dot);
//         }
//         return name.substring(0, nameLC.length());
//     }
// 
// }
// 
// Path: dbpatch-core/src/main/java/org/jsoftware/dbpatch/config/EnvSettings.java
// public class EnvSettings {
//     private final String prefix;
// 
//     private EnvSettings(String prefix) {
//         this.prefix = prefix;
//     }
// 
//     public String getDbPatchFile() {
//         return prefix + "dbpatch.file";
//     }
// 
//     public String getDbPatchConfiguration() {
//         return prefix + "dbpatch.configuration";
//     }
// 
//     public String getDbPatchStop() {
//         return prefix + "dbpatch.stop";
//     }
// 
//     public String getDbPatchSingle() {
//         return prefix + "dbpatch.single";
//     }
// 
//     public String getLogLevel() {
//         return prefix + "dbpatch.logLevel";
//     }
// 
//     public static EnvSettings standalone() {
//         return new EnvSettings("");
//     }
// 
//     public static EnvSettings maven() {
//         return new EnvSettings("maven.");
//     }
// 
//     public static EnvSettings gradle() {
//         return new EnvSettings("gradle.");
//     }
// 
// }
// 
// Path: dbpatch-core/src/main/java/org/jsoftware/dbpatch/config/PatchScanner.java
// public interface PatchScanner extends Serializable {
// 
//     /**
//      * @param directory base dir
//      * @param paths to scan (add directory if not absolute)
//      * @return list of found patches
//      * @throws DuplicatePatchNameException when duplicated patch names were found
//      * @throws IOException io problem
//      */
//     List<Patch> scan(File directory, String[] paths) throws DuplicatePatchNameException, IOException;
// 
//     /**
//      * @param patch rollbacks for this patch
//      * @param directory base dir
//      * @param paths to scan (add directory if not absolute)
//      * @return null if no file was found
//      * @throws DuplicatePatchNameException when duplicated patch names were found
//      * @throws IOException io problem
//      */
//     File findRollbackFile(File directory, String[] paths, Patch patch) throws DuplicatePatchNameException, IOException;
// }
// 
// Path: dbpatch-core/src/main/java/org/jsoftware/dbpatch/impl/DuplicatePatchNameException.java
// public class DuplicatePatchNameException extends CommandFailureException {
//     private static final long serialVersionUID = 5221931112583803769L;
// 
//     public DuplicatePatchNameException(Object source, Patch patch1, Patch patch2) {
//         super(source, "Duplicate patch name", "Patches name \"" + patch1.getName() + "\" conflict between " + patch1.getFile().getAbsolutePath() + " and " + patch2.getFile().getAbsolutePath());
//     }
// 
// }


import org.jsoftware.dbpatch.config.AbstractPatch;
import org.jsoftware.dbpatch.config.EnvSettings;
import org.jsoftware.dbpatch.config.Patch;
import org.jsoftware.dbpatch.config.PatchScanner;
import org.jsoftware.dbpatch.impl.DuplicatePatchNameException;
import java.io.IOException;
import java.sql.SQLException;
import java.util.List;
package org.jsoftware.dbpatch.command;




/**
 * Show list of patches
 *
 * @author szalik
 */
abstract class AbstractListCommand<P extends AbstractPatch> extends AbstractSingleConfDbPatchCommand {
    static final int SPACES = 46;

    public AbstractListCommand(EnvSettings envSettings) {
        super(envSettings);
    }

    /**
     * @return patches to apply
     * @throws java.io.IOException
     * @throws java.sql.SQLException
     * @throws DuplicatePatchNameException
     */
    private List<Patch> generatePatchListAll() throws IOException, SQLException, DuplicatePatchNameException {
// Path: dbpatch-core/src/main/java/org/jsoftware/dbpatch/config/AbstractPatch.java
// public abstract class AbstractPatch implements Serializable {
//     private static final long serialVersionUID = 4178101927323891639L;
//     private String name;
//     private int statementCount = -1;
//     private File file;
// 
//     public enum DbState {
//         COMMITTED, IN_PROGRESS, NOT_AVAILABLE
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public int getStatementCount() {
//         return statementCount;
//     }
// 
//     public void setStatementCount(int statementCount) {
//         this.statementCount = statementCount;
//     }
// 
//     public File getFile() {
//         return file;
//     }
// 
//     public void setFile(File file) {
//         this.file = file;
//     }
// 
//     public abstract void setDbDate(Date dbDate);
// 
//     public abstract void setDbState(DbState dbState);
// 
//     public abstract Date getDbDate();
// 
//     public abstract DbState getDbState();
// 
//     public abstract boolean canApply();
// 
//     public String toString() {
//         return super.toString() + "-" + name;
//     }
// 
//     public static String normalizeName(String name) {
//         String nameLC = name.toLowerCase();
//         while (nameLC.endsWith(".sql") || nameLC.endsWith(".undo") || nameLC.endsWith(".rollback")) {
//             int dot = nameLC.lastIndexOf('.');
//             nameLC = nameLC.substring(0, dot);
//         }
//         return name.substring(0, nameLC.length());
//     }
// 
// }
// 
// Path: dbpatch-core/src/main/java/org/jsoftware/dbpatch/config/EnvSettings.java
// public class EnvSettings {
//     private final String prefix;
// 
//     private EnvSettings(String prefix) {
//         this.prefix = prefix;
//     }
// 
//     public String getDbPatchFile() {
//         return prefix + "dbpatch.file";
//     }
// 
//     public String getDbPatchConfiguration() {
//         return prefix + "dbpatch.configuration";
//     }
// 
//     public String getDbPatchStop() {
//         return prefix + "dbpatch.stop";
//     }
// 
//     public String getDbPatchSingle() {
//         return prefix + "dbpatch.single";
//     }
// 
//     public String getLogLevel() {
//         return prefix + "dbpatch.logLevel";
//     }
// 
//     public static EnvSettings standalone() {
//         return new EnvSettings("");
//     }
// 
//     public static EnvSettings maven() {
//         return new EnvSettings("maven.");
//     }
// 
//     public static EnvSettings gradle() {
//         return new EnvSettings("gradle.");
//     }
// 
// }
// 
// Path: dbpatch-core/src/main/java/org/jsoftware/dbpatch/config/PatchScanner.java
// public interface PatchScanner extends Serializable {
// 
//     /**
//      * @param directory base dir
//      * @param paths to scan (add directory if not absolute)
//      * @return list of found patches
//      * @throws DuplicatePatchNameException when duplicated patch names were found
//      * @throws IOException io problem
//      */
//     List<Patch> scan(File directory, String[] paths) throws DuplicatePatchNameException, IOException;
// 
//     /**
//      * @param patch rollbacks for this patch
//      * @param directory base dir
//      * @param paths to scan (add directory if not absolute)
//      * @return null if no file was found
//      * @throws DuplicatePatchNameException when duplicated patch names were found
//      * @throws IOException io problem
//      */
//     File findRollbackFile(File directory, String[] paths, Patch patch) throws DuplicatePatchNameException, IOException;
// }
// 
// Path: dbpatch-core/src/main/java/org/jsoftware/dbpatch/impl/DuplicatePatchNameException.java
// public class DuplicatePatchNameException extends CommandFailureException {
//     private static final long serialVersionUID = 5221931112583803769L;
// 
//     public DuplicatePatchNameException(Object source, Patch patch1, Patch patch2) {
//         super(source, "Duplicate patch name", "Patches name \"" + patch1.getName() + "\" conflict between " + patch1.getFile().getAbsolutePath() + " and " + patch2.getFile().getAbsolutePath());
//     }
// 
// }


// Path: dbpatch-core/src/main/java/org/jsoftware/dbpatch/command/AbstractListCommand.java
import org.jsoftware.dbpatch.config.AbstractPatch;
import org.jsoftware.dbpatch.config.EnvSettings;
import org.jsoftware.dbpatch.config.Patch;
import org.jsoftware.dbpatch.config.PatchScanner;
import org.jsoftware.dbpatch.impl.DuplicatePatchNameException;
import java.io.IOException;
import java.sql.SQLException;
import java.util.List;

package org.jsoftware.dbpatch.command;




/**
 * Show list of patches
 *
 * @author szalik
 */
abstract class AbstractListCommand<P extends AbstractPatch> extends AbstractSingleConfDbPatchCommand {
    static final int SPACES = 46;

    public AbstractListCommand(EnvSettings envSettings) {
        super(envSettings);
    }

    /**
     * @return patches to apply
     * @throws java.io.IOException
     * @throws java.sql.SQLException
     * @throws DuplicatePatchNameException
     */
    private List<Patch> generatePatchListAll() throws IOException, SQLException, DuplicatePatchNameException {
        PatchScanner scanner = configurationEntry.getPatchScanner();