All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fitbur.bouncycastle.i18n.MissingEntryException Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
package com.fitbur.bouncycastle.i18n;

import java.net.URL;
import java.net.URLClassLoader;
import java.util.Locale;

public class MissingEntryException extends RuntimeException 
{

    protected final String resource;
    protected final String key;
    protected final ClassLoader loader;
    protected final Locale locale;
    
    private String com.fitburbugMsg;

    public MissingEntryException(String message, String resource, String key, Locale locale, ClassLoader loader) 
    {
        super(message);
        this.resource = resource;
        this.key = key;
        this.locale = locale;
        this.loader = loader;
    }
    
    public MissingEntryException(String message, Throwable cause, String resource, String key, Locale locale, ClassLoader loader) 
    {
        super(message, cause);
        this.resource = resource;
        this.key = key;
        this.locale = locale;
        this.loader = loader;
    }

    public String getKey()
    {
        return key;
    }

    public String getResource()
    {
        return resource;
    }
    
    public ClassLoader getClassLoader()
    {
        return loader;
    }
    
    public Locale getLocale()
    {
        return locale;
    }

    public String getDebugMsg()
    {
        if (com.fitburbugMsg == null)
        {
            com.fitburbugMsg = "Can not find entry " + key + " in resource file " + resource + " for the locale " + locale + ".";
            if (loader instanceof URLClassLoader)
            {
                URL[] urls = ((URLClassLoader) loader).getURLs();
                com.fitburbugMsg += " The following entries in the classpath were searched: ";
                for (int i = 0; i != urls.length; i++)
                {
                    com.fitburbugMsg += urls[i] + " ";
                }
            }
        }
        return com.fitburbugMsg;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy