AESProperties.java 2.64 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  com.adobe.pdfg.logging.PDFGLogger
 */
package com.adobe.pdfg.common;

import com.adobe.pdfg.common.EarProperties;
import com.adobe.pdfg.logging.PDFGLogger;
import java.util.Locale;
import java.util.Map;
import java.util.Properties;

public class AESProperties
extends EarProperties {
    protected static AESProperties instance = null;
    private static PDFGLogger pdfgLogger = PDFGLogger.getPDFGLogger(AESProperties.class);

    protected AESProperties() {
        this.init(null, this.getClass().getClassLoader());
    }

    public static AESProperties getInstance() {
        if (instance == null || AESProperties.instance.tryCreationAgain) {
            instance = new AESProperties();
        }
        return instance;
    }

    public static String getProperty(String key) {
        return AESProperties.getInstance().properties.getProperty(key);
    }

    public static String getProperty(String key, String defaultValue) {
        return AESProperties.getInstance().properties.getProperty(key, defaultValue);
    }

    public static Object setProperty(String key, String value) {
        return AESProperties.getInstance().properties.setProperty(key, value);
    }

    public static int getIntProperty(String key, int defaultValue) {
        return AESProperties.getInstance().virtualGetIntProperty(key, defaultValue);
    }

    public static int getMaximumTimeout() {
        int timeoutSeconds = AESProperties.getIntProperty("server.conversion.timeout", 270);
        return timeoutSeconds;
    }

    public static int getGlobalTimeout() {
        int timeoutSeconds = AESProperties.getIntProperty("server.global.timeout", 300);
        return timeoutSeconds;
    }

    public static int getJobCleanupScanSeconds() {
        try {
            return AESProperties.getIntProperty("server.pdfg.cleanup.scan.seconds", 0);
        }
        catch (Exception e) {
            pdfgLogger.trace(e.getMessage(), null, (Throwable)e);
            return 0;
        }
    }

    public static int getJobExpirationSeconds() {
        try {
            return AESProperties.getIntProperty("server.pdfg.job.expiration.seconds", 0);
        }
        catch (Exception e) {
            pdfgLogger.trace(e.getMessage(), null, (Throwable)e);
            return 0;
        }
    }

    public static Locale getLocale() {
        String localeSet = AESProperties.getProperty("server.locale");
        if (localeSet == null) {
            return null;
        }
        return new Locale(localeSet);
    }

    public static void initialize(Map config) {
        AESProperties.getInstance().properties.putAll(config);
    }
}