blob: ffd4d543bf9281abb70a65d2f74c8e1621ee3a9b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
package org.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 debugMsg;
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 (debugMsg == null)
{
debugMsg = "Can not find entry " + key + " in resource file " + resource + " for the locale " + locale + ".";
if (loader instanceof URLClassLoader)
{
URL[] urls = ((URLClassLoader) loader).getURLs();
debugMsg += " The following entries in the classpath were searched: ";
for (int i = 0; i != urls.length; i++)
{
debugMsg += urls[i] + " ";
}
}
}
return debugMsg;
}
}
|