ICUData.java
2.09 KB
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
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.agl.impl;
import java.io.InputStream;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.MissingResourceException;
public final class ICUData {
private static InputStream getStream(final Class root, final String resourceName, boolean required) {
InputStream i = null;
i = System.getSecurityManager() != null ? (InputStream)AccessController.doPrivileged(new PrivilegedAction(){
public Object run() {
return root.getResourceAsStream(resourceName);
}
}) : root.getResourceAsStream(resourceName);
if (i == null && required) {
throw new MissingResourceException("could not locate data " + resourceName, root.getPackage().getName(), resourceName);
}
return i;
}
private static InputStream getStream(final ClassLoader loader, final String resourceName, boolean required) {
InputStream i = null;
i = System.getSecurityManager() != null ? (InputStream)AccessController.doPrivileged(new PrivilegedAction(){
public Object run() {
return loader.getResourceAsStream(resourceName);
}
}) : loader.getResourceAsStream(resourceName);
if (i == null && required) {
throw new MissingResourceException("could not locate data", loader.toString(), resourceName);
}
return i;
}
public static InputStream getStream(ClassLoader loader, String resourceName) {
return ICUData.getStream(loader, resourceName, false);
}
public static InputStream getRequiredStream(ClassLoader loader, String resourceName) {
return ICUData.getStream(loader, resourceName, true);
}
public static InputStream getStream(String resourceName) {
Class class_ = ICUData.class;
return ICUData.getStream(class_, resourceName, false);
}
public static InputStream getRequiredStream(String resourceName) {
Class class_ = ICUData.class;
return ICUData.getStream(class_, resourceName, true);
}
}