/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.service.ServiceDocumentWsdlStrategy
 *  com.l7tech.gateway.common.service.ServiceDocumentWsdlStrategy$ServiceDocumentResources
 *  com.l7tech.util.Config
 *  com.l7tech.util.Functions$Nullary
 *  com.l7tech.util.Option
 */
package com.l7tech.server.upgrade;

import com.l7tech.gateway.common.service.ServiceDocumentWsdlStrategy;
import com.l7tech.server.upgrade.a;
import com.l7tech.server.upgrade.d;
import com.l7tech.util.Config;
import com.l7tech.util.Functions;
import com.l7tech.util.Option;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.logging.Level;

class c
implements Functions.Nullary<Option<ServiceDocumentWsdlStrategy.ServiceDocumentResources>> {
    final Config val$config;
    final a this$0;
    private static final String[] a;

    /*
     * Ignored method signature, as it can't be verified against descriptor
     */
    c(a a10, Config config) {
        this.this$0 = a10;
        this.val$config = config;
    }

    public Option<ServiceDocumentWsdlStrategy.ServiceDocumentResources> call() {
        Option option;
        block8: {
            String[] stringArray;
            block7: {
                Option option2;
                block6: {
                    option = Option.none();
                    stringArray = a;
                    File file = new File(this.val$config.getProperty(stringArray[0], stringArray[7]));
                    if (!file.isDirectory()) break block7;
                    option2 = Option.optional((Object)file.listFiles(new d(this)));
                    try {
                        if (!option2.isSome() || ((File[])option2.some()).length != 1) break block6;
                    }
                    catch (MalformedURLException malformedURLException) {
                        throw c.a(malformedURLException);
                    }
                    try {
                        URLClassLoader uRLClassLoader = new URLClassLoader(new URL[]{((File[])option2.some())[0].toURI().toURL()}, null);
                        option = Option.some((Object)ServiceDocumentWsdlStrategy.loadResources((String)this.this$0.f, (String)this.this$0.d, (String)this.this$0.g, (ClassLoader)uRLClassLoader));
                    }
                    catch (MalformedURLException malformedURLException) {
                        stringArray = a;
                        com.l7tech.server.upgrade.a.a.log(Level.WARNING, stringArray[4] + this.this$0.c + stringArray[6], malformedURLException);
                    }
                    catch (URISyntaxException uRISyntaxException) {
                        stringArray = a;
                        com.l7tech.server.upgrade.a.a.log(Level.WARNING, stringArray[1] + this.this$0.c + stringArray[8], uRISyntaxException);
                    }
                    catch (IOException iOException) {
                        stringArray = a;
                        com.l7tech.server.upgrade.a.a.log(Level.WARNING, stringArray[1] + this.this$0.c + stringArray[8], iOException);
                    }
                    break block8;
                }
                stringArray = a;
                com.l7tech.server.upgrade.a.a.warning(stringArray[1] + this.this$0.c + stringArray[3] + ((File[])option2.some()).length + stringArray[2]);
                break block8;
            }
            stringArray = a;
            com.l7tech.server.upgrade.a.a.warning(stringArray[1] + this.this$0.c + stringArray[5]);
        }
        return option;
    }

    private static MalformedURLException a(MalformedURLException malformedURLException) {
        return malformedURLException;
    }

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[9];
                var3_1 = 0;
                var2_2 = "e\u007fUw\u0000g2IcBg\u001er)g~BF\u0005t%kd^p\u00152MbCm\u001e&,gqUk\u0002a`}`Uc\u0018c$(GbF &2mc^w\u001ee%(v^pLs0obPf\u0005h'(\t(}^f\u0019j%{>\u001a(y_v\tt.i|\u0011q\tt6asTq@&&ge_fL2MbCm\u001e&,gqUk\u0002a`}`Uc\u0018c$(GbF &2mc^w\u001ee%(v^pLs0obPf\u0005h'(1(y_v\tt.i|\u0011q\tt6asTq@&-gtDn\rt`icBg\u001er)g~B\"\u0002i4(v^w\u0002bn\u0013(y_v\tt.i|\u0011q\tt6asTqB";
                var4_3 = "e\u007fUw\u0000g2IcBg\u001er)g~BF\u0005t%kd^p\u00152MbCm\u001e&,gqUk\u0002a`}`Uc\u0018c$(GbF &2mc^w\u001ee%(v^pLs0obPf\u0005h'(\t(}^f\u0019j%{>\u001a(y_v\tt.i|\u0011q\tt6asTq@&&ge_fL2MbCm\u001e&,gqUk\u0002a`}`Uc\u0018c$(GbF &2mc^w\u001ee%(v^pLs0obPf\u0005h'(1(y_v\tt.i|\u0011q\tt6asTq@&-gtDn\rt`icBg\u001er)g~B\"\u0002i4(v^w\u0002bn\u0013(y_v\tt.i|\u0011q\tt6asTqB".length();
                var1_4 = 26;
                var0_5 = -1;
lbl7:
                // 2 sources

                while (true) {
                    v0 = 25;
                    v1 = ++var0_5;
                    v2 = var2_2.substring(v1, v1 + var1_4);
                    v3 = -1;
                    break block9;
                    break;
                }
lbl13:
                // 1 sources

                while (true) {
                    var5[var3_1++] = c.a(v0, c.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "\u0017OqFse\u0015[UsW\u000fF\u0011V\u000fFS(S\u0007YY.@)X\u0004QMd\u001d1Y\u0014MLdAsW\u0003KEsF5Y\u001eK\u0013\u0018IoF9D\u001eYL!A9D\u0006QCdAr";
                    var4_3 = "\u0017OqFse\u0015[UsW\u000fF\u0011V\u000fFS(S\u0007YY.@)X\u0004QMd\u001d1Y\u0014MLdAsW\u0003KEsF5Y\u001eK\u0013\u0018IoF9D\u001eYL!A9D\u0006QCdAr".length();
                    var1_4 = 50;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 41;
                        v4 = ++var0_5;
                        v2 = var2_2.substring(v4, v4 + var1_4);
                        v3 = 0;
                        break block9;
                        break;
                    }
                    break;
                }
lbl28:
                // 1 sources

                while (true) {
                    var5[var3_1++] = c.a(v0, c.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    break block10;
                    break;
                }
            }
            switch (v3) {
                default: {
                    ** continue;
                }
                ** case 0:
lbl39:
                // 1 sources

                ** continue;
            }
        }
        c.a = var5;
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x59);
        }
        return cArray;
    }

    /*
     * Handled impossible loop by duplicating code
     * Enabled aggressive block sorting
     */
    private static String a(int n2, char[] cArray) {
        char[] cArray2;
        block11: {
            int n3;
            int n4;
            int n5;
            block10: {
                n5 = n2;
                cArray2 = cArray;
                n4 = cArray.length;
                n3 = 0;
                if (!true) break block10;
                n4 = n4;
                if (n4 <= n3) break block11;
            }
            do {
                n5 = n5;
                cArray2 = cArray2;
                int n6 = n3;
                cArray2[n6] = (char)(cArray2[n6] ^ (n5 ^ (switch (n3 % 7) {
                    case 0 -> 17;
                    case 1 -> 9;
                    case 2 -> 40;
                    case 3 -> 27;
                    case 4 -> 117;
                    case 5 -> 31;
                    default -> 89;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

