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

Method loadResource

app/src/main/java/javax/mail/Session.java:1166–1190  ·  view source on GitHub ↗

Load from the named resource.

(String name, Class<?> cl, StreamLoader loader,
				boolean expected)

Source from the content-addressed store, hash-verified

1164 * Load from the named resource.
1165 */
1166 private void loadResource(String name, Class<?> cl, StreamLoader loader,
1167 boolean expected) {
1168 InputStream clis = null;
1169 try {
1170 clis = getResourceAsStream(cl, name);
1171 if (clis != null) {
1172 loader.load(clis);
1173 logger.log(Level.CONFIG, "successfully loaded resource: {0}",
1174 name);
1175 } else {
1176 if (expected)
1177 logger.log(Level.WARNING,
1178 "expected resource not found: {0}", name);
1179 }
1180 } catch (IOException e) {
1181 logger.log(Level.CONFIG, "Exception loading resource", e);
1182 } catch (SecurityException sex) {
1183 logger.log(Level.CONFIG, "Exception loading resource", sex);
1184 } finally {
1185 try {
1186 if (clis != null)
1187 clis.close();
1188 } catch (IOException ex) { } // ignore it
1189 }
1190 }
1191
1192 /**
1193 * Load all of the named resource.

Callers 3

loadProvidersMethod · 0.95
loadAddressMapMethod · 0.95
loadAllResourcesMethod · 0.95

Calls 4

getResourceAsStreamMethod · 0.95
loadMethod · 0.65
logMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected