MCPcopy Create free account
hub / github.com/M66B/FairEmail / getResourceAsStream

Method getResourceAsStream

app/src/main/java/javax/mail/Session.java:1274–1296  ·  view source on GitHub ↗
(final Class<?> c,
				final String name)

Source from the content-addressed store, hash-verified

1272 }
1273
1274 private static InputStream getResourceAsStream(final Class<?> c,
1275 final String name) throws IOException {
1276 try {
1277 return AccessController.doPrivileged(
1278 new PrivilegedExceptionAction<InputStream>() {
1279 @Override
1280 public InputStream run() throws IOException {
1281 try {
1282 return c.getResourceAsStream(name);
1283 } catch (RuntimeException e) {
1284 // gracefully handle ClassLoader bugs (Tomcat)
1285 IOException ioex = new IOException(
1286 "ClassLoader.getResourceAsStream failed");
1287 ioex.initCause(e);
1288 throw ioex;
1289 }
1290 }
1291 }
1292 );
1293 } catch (PrivilegedActionException e) {
1294 throw (IOException)e.getException();
1295 }
1296 }
1297
1298 private static URL[] getResources(final ClassLoader cl, final String name) {
1299 return AccessController.doPrivileged(new PrivilegedAction<URL[]>() {

Callers 3

loadResourceMethod · 0.95
runMethod · 0.45
MimeUtilityClass · 0.45

Calls 1

getExceptionMethod · 0.45

Tested by

no test coverage detected