(String[] attrs, String fullName, boolean selectable)
| 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) |
no test coverage detected