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

Method setCapabilities

app/src/main/java/com/sun/mail/pop3/Protocol.java:213–243  ·  view source on GitHub ↗

Parse the capabilities from a CAPA response.

(InputStream in)

Source from the content-addressed store, hash-verified

211 * Parse the capabilities from a CAPA response.
212 */
213 synchronized void setCapabilities(InputStream in) {
214 if (in == null) {
215 capabilities = null;
216 return;
217 }
218
219 capabilities = new HashMap<>(10);
220 BufferedReader r = null;
221 try {
222 r = new BufferedReader(new InputStreamReader(in, "us-ascii"));
223 } catch (UnsupportedEncodingException ex) {
224 // should never happen
225 assert false;
226 }
227 String s;
228 try {
229 while ((s = r.readLine()) != null) {
230 String cap = s;
231 int i = cap.indexOf(' ');
232 if (i > 0)
233 cap = cap.substring(0, i);
234 capabilities.put(cap.toUpperCase(Locale.ENGLISH), s);
235 }
236 } catch (IOException ex) {
237 // should never happen
238 } finally {
239 try {
240 in.close();
241 } catch (IOException ex) { }
242 }
243 }
244
245 /**
246 * Check whether the given capability is supported by

Callers 2

getPortMethod · 0.95
ProtocolMethod · 0.95

Calls 4

indexOfMethod · 0.80
readLineMethod · 0.45
putMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected