I have to implement an IMAP Client in Java.
Which advantages has using the Apache Commons Net library? Does it make the implementation robust and more flexible?
How do I have to handle return values, it always produces strings.
For example:
public static void main(String[] args) throws Exception {
IMAPClient client = new IMAPClient();
client.connect(SERVER);
client.login(USERNAME, PASSWORD);
client.select("INBOX");
client.fetch("1", "body[header]");
}
and we can direct the output to string by
client.addProtocolCommandListener(new PrintCommandListener(System.out, true));
But how can I get a list of folders as folder instances instead of pure string output?