// Path: src/main/java/com/excelsiorjet/api/tasks/JetTaskFailureException.java
// public class JetTaskFailureException extends Exception {
// 
//     public JetTaskFailureException(String msg, Throwable throwable) {
//         super(msg, throwable);
//     }
// 
//     public JetTaskFailureException(String msg) {
//         super(msg);
//     }
// }
// 
// Path: src/main/java/com/excelsiorjet/api/util/Txt.java
// public static String s(String id, Object... params) {
//     String str = null;
//     if (altMessages != null) {
//         str = altMessages.format(id, params);
//     }
//     if (str == null) {
//         str = messages.format(id, params);
//     }
//     if (str != null) {
//         return str;
//     } else {
//         if (log != null) {
//             log.error("JET message file broken: key = " + id);
//         } else {
//             throw new IllegalStateException("No log to issue error. JET message file broken: key = " + id);
//         }
//         return id;
//     }
// }


import java.io.File;
import static com.excelsiorjet.api.util.Txt.s;
import com.excelsiorjet.api.tasks.JetTaskFailureException;

    public PackageFile(File path, String packagePath) {
        this.path = path;
        this.packagePath = packagePath;
    }

    public boolean isDefined() {
        return (path != null) || (packagePath != null);
    }

    /**
     * @return location of this file in the package including file name, or empty string if the file is not {@link #isDefined()}}
     */
    public String getLocationInPackage() {
        if (!isDefined()) {
            return "";
        } else if (path != null) {
            assert packagePath != null: "validate() must be called before";
            return packagePath.endsWith("/") ? packagePath + path.getName() : packagePath + "/" + path.getName();
        } else {
            return packagePath;
        }
    }

    public void validate(String notExistErrorKey, String errorParam) throws JetTaskFailureException {
        if (!isDefined())
            return;

        if (path != null) {
            if (!path.exists()) {
// Path: src/main/java/com/excelsiorjet/api/tasks/JetTaskFailureException.java
// public class JetTaskFailureException extends Exception {
// 
//     public JetTaskFailureException(String msg, Throwable throwable) {
//         super(msg, throwable);
//     }
// 
//     public JetTaskFailureException(String msg) {
//         super(msg);
//     }
// }
// 
// Path: src/main/java/com/excelsiorjet/api/util/Txt.java
// public static String s(String id, Object... params) {
//     String str = null;
//     if (altMessages != null) {
//         str = altMessages.format(id, params);
//     }
//     if (str == null) {
//         str = messages.format(id, params);
//     }
//     if (str != null) {
//         return str;
//     } else {
//         if (log != null) {
//             log.error("JET message file broken: key = " + id);
//         } else {
//             throw new IllegalStateException("No log to issue error. JET message file broken: key = " + id);
//         }
//         return id;
//     }
// }


// Path: src/main/java/com/excelsiorjet/api/tasks/config/packagefile/PackageFile.java
import java.io.File;
import static com.excelsiorjet.api.util.Txt.s;
import com.excelsiorjet.api.tasks.JetTaskFailureException;


    public PackageFile(File path, String packagePath) {
        this.path = path;
        this.packagePath = packagePath;
    }

    public boolean isDefined() {
        return (path != null) || (packagePath != null);
    }

    /**
     * @return location of this file in the package including file name, or empty string if the file is not {@link #isDefined()}}
     */
    public String getLocationInPackage() {
        if (!isDefined()) {
            return "";
        } else if (path != null) {
            assert packagePath != null: "validate() must be called before";
            return packagePath.endsWith("/") ? packagePath + path.getName() : packagePath + "/" + path.getName();
        } else {
            return packagePath;
        }
    }

    public void validate(String notExistErrorKey, String errorParam) throws JetTaskFailureException {
        if (!isDefined())
            return;

        if (path != null) {
            if (!path.exists()) {
                throw new JetTaskFailureException(s(notExistErrorKey, path.getAbsolutePath(), errorParam));