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

Method loadFile

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

Load from the named file.

(String name, StreamLoader loader)

Source from the content-addressed store, hash-verified

1139 * Load from the named file.
1140 */
1141 private void loadFile(String name, StreamLoader loader) {
1142 InputStream clis = null;
1143 try {
1144 clis = new BufferedInputStream(new FileInputStream(name));
1145 loader.load(clis);
1146 logger.log(Level.CONFIG, "successfully loaded file: {0}", name);
1147 } catch (FileNotFoundException fex) {
1148 // ignore it
1149 } catch (IOException e) {
1150 if (logger.isLoggable(Level.CONFIG))
1151 logger.log(Level.CONFIG, "not loading file: " + name, e);
1152 } catch (SecurityException sex) {
1153 if (logger.isLoggable(Level.CONFIG))
1154 logger.log(Level.CONFIG, "not loading file: " + name, sex);
1155 } finally {
1156 try {
1157 if (clis != null)
1158 clis.close();
1159 } catch (IOException ex) { } // ignore it
1160 }
1161 }
1162
1163 /**
1164 * Load from the named resource.

Callers 2

loadProvidersMethod · 0.95
loadAddressMapMethod · 0.95

Calls 4

loadMethod · 0.65
logMethod · 0.45
isLoggableMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected