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

Method ID

app/src/main/java/com/sun/mail/imap/protocol/ID.java:41–70  ·  view source on GitHub ↗

Parse the server parameter list out of the response. @param r the response @exception ProtocolException for protocol failures

(Response r)

Source from the content-addressed store, hash-verified

39 * @exception ProtocolException for protocol failures
40 */
41 public ID(Response r) throws ProtocolException {
42 // id_response ::= "ID" SPACE id_params_list
43 // id_params_list ::= "(" #(string SPACE nstring) ")" / nil
44 // ;; list of field value pairs
45
46 r.skipSpaces();
47 int c = r.peekByte();
48 if (c == 'N' || c == 'n') // assume NIL
49 return;
50
51 if (c != '(')
52 throw new ProtocolException("Missing '(' at start of ID");
53
54 serverParams = new HashMap<>();
55
56 String[] v = r.readStringList();
57 if (v != null) {
58 for (int i = 0; i < v.length; i += 2) {
59 String name = v[i];
60 if (name == null)
61 throw new ProtocolException("ID field name null");
62 if (i + 1 >= v.length)
63 throw new ProtocolException("ID field without value: " +
64 name);
65 String value = v[i + 1];
66 serverParams.put(name, value);
67 }
68 }
69 serverParams = Collections.unmodifiableMap(serverParams);
70 }
71
72 /**
73 * Return the parsed server params.

Callers

nothing calls this directly

Calls 4

skipSpacesMethod · 0.80
peekByteMethod · 0.80
readStringListMethod · 0.80
putMethod · 0.45

Tested by

no test coverage detected