Get the separator character.
()
| 685 | * Get the separator character. |
| 686 | */ |
| 687 | @Override |
| 688 | public synchronized char getSeparator() throws MessagingException { |
| 689 | if (separator == UNKNOWN_SEPARATOR) { |
| 690 | ListInfo[] li = null; |
| 691 | |
| 692 | li = (ListInfo[])doCommand(new ProtocolCommand() { |
| 693 | @Override |
| 694 | public Object doCommand(IMAPProtocol p) |
| 695 | throws ProtocolException { |
| 696 | // REV1 allows the following LIST format to obtain |
| 697 | // the hierarchy delimiter of non-existent folders |
| 698 | if (p.isREV1()) // IMAP4rev1 |
| 699 | return p.list(fullName, ""); |
| 700 | else // IMAP4, note that this folder must exist for this |
| 701 | // to work :( |
| 702 | return p.list("", fullName); |
| 703 | } |
| 704 | }); |
| 705 | |
| 706 | if (li != null) |
| 707 | separator = li[0].separator; |
| 708 | else |
| 709 | separator = '/'; // punt ! |
| 710 | } |
| 711 | return separator; |
| 712 | } |
| 713 | |
| 714 | /** |
| 715 | * Get the type of this folder. |