* @param name the name of the folder
* @param store instance of Gmail {@link Store}
*/
private Folder getFolder(String name, final Store store) {
if (store == null) {
throw new GmailException("Gmail IMAP store cannot be null");
}
try {
name = ((name == null) ? this.srcFolder : name);
Folder folder = store.getFolder(name);
if (folder.exists()) {
return folder;
}
} catch (final Exception e) {
throw new GmailException("ImapGmailClient failed getting "
+ "Folder: " + name, e);
}
throw new GmailException("ImapGmailClient Folder name cannot be null");
}