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

Method getType

app/src/main/java/eu/faircode/email/EntityFolder.java:532–550  ·  view source on GitHub ↗
(String[] attrs, String fullName, boolean selectable)

Source from the content-addressed store, hash-verified

530 }
531
532 static String getType(String[] attrs, String fullName, boolean selectable) {
533 // https://tools.ietf.org/html/rfc3501#section-5.1
534 if ("INBOX".equals(fullName.toUpperCase(Locale.ROOT)))
535 return INBOX;
536
537 // https://www.iana.org/assignments/imap-mailbox-name-attributes/imap-mailbox-name-attributes.xhtml
538 for (String attr : attrs) {
539 if ((selectable && "\\NoSelect".equalsIgnoreCase(attr)) || "\\NonExistent".equalsIgnoreCase(attr))
540 return null;
541
542 if (attr.startsWith("\\")) {
543 int index = SYSTEM_FOLDER_ATTR.indexOf(attr.substring(1).toLowerCase(Locale.ROOT));
544 if (index >= 0)
545 return SYSTEM_FOLDER_TYPE.get(index);
546 }
547 }
548
549 return USER;
550 }
551
552 static String getSubtype(String[] attrs, String fullname) {
553 for (String attr : attrs)

Callers 2

getFoldersMethod · 0.95
onSynchronizeFoldersMethod · 0.95

Calls 3

indexOfMethod · 0.80
equalsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected