public void createFolder() throws Exception { Folder f = getFolder(); try { if (!f.exists()) { f.create(Folder.HOLDS_MESSAGES); f.setSubscribed(true); } else { if (!f.isSubscribed()) { f.setSubscribed(true); } } } catch (MessagingException e) { log.warn("Could not create folder: " + f.getName()); } }
/** @param newName */ public void renameFolder(String newName) throws Exception { Folder fOld = getFolder(); Folder fNew = handler.getStore().getFolder(profile.getFolderNameSpace() + newName); closeFolder(fOld); fOld.renameTo(fNew); fNew.setSubscribed(true); }
public void deleteFolder() throws Exception { Folder f = getFolder(); f.setSubscribed(false); closeFolder(f); f.delete(true); }