static Signable of()

in jsign-core/src/main/java/net/jsign/Signable.java [107:139]


    static Signable of(File file, Charset encoding) throws IOException {
        if (PEFile.isPEFile(file)) {
            return new PEFile(file);

        } else if (MSIFile.isMSIFile(file)) {
            return new MSIFile(file);

        } else if (MSCabinetFile.isMSCabinetFile(file)) {
            return new MSCabinetFile(file);

        } else if (file.getName().endsWith(".ps1")
                || file.getName().endsWith(".psd1")
                || file.getName().endsWith(".psm1")) {
            return new PowerShellScript(file, encoding);

        } else if (file.getName().endsWith(".ps1xml")) {
            return new PowerShellXMLScript(file, encoding);

        } else if (file.getName().endsWith(".vbs")
                || file.getName().endsWith(".vbe")) {
            return new VBScript(file, encoding);

        } else if (file.getName().endsWith(".js")
                || file.getName().endsWith(".jse")) {
            return new JScript(file, encoding);

        } else if (file.getName().endsWith(".wsf")) {
            return new WindowsScript(file, encoding);

        } else {
            throw new UnsupportedOperationException("Unsupported file: " + file);
        }
    }