/** * Delete this folder. */ public synchronized boolean delete(boolean recurse) throws MessagingException { checkClosed(); // insure that this folder is closed. if (recurse) { // Delete all subfolders. Folder[] f = list(); for (int i = 0; i < f.length; i++) f[i].delete(recurse); // ignore intermediate failures } // Attempt to delete this folder Object ret = doCommandIgnoreFailure(new ProtocolCommand() { public Object doCommand(IMAPProtocol p) throws ProtocolException { p.delete(fullName); return Boolean.TRUE; } }); if (ret == null) // Non-existent folder/No permission ?? return false; // DELETE succeeded. exists = false; attributes = null; // Notify listeners on self and our Store notifyFolderListeners(FolderEvent.DELETED); return true; }
Folder[] f = list(); for (int i = 0; i < f.length; i++)
public static Folder[] IMAPFolder_list(IMAPFolder folder) throws MessagingException { if (!Profiler.INSTANCE.isActive()) // only needed for better performance return folder.list(); return (Folder[])profileInvokeMExcep(folder, "list"); }
public FetchFoldersResult executeInternal(FetchFolders action, ExecutionContext arg1) throws ActionException { User user = getUser(); try { // get the store for the user IMAPStore store = cache.get(user); com.sun.mail.imap.IMAPFolder folder = (com.sun.mail.imap.IMAPFolder) store.getDefaultFolder(); // List of mail 'root' imap folders List<IMAPFolder> imapFolders = new ArrayList<IMAPFolder>(); // Create IMAPFolder tree list for (Folder f : folder.list()) { IMAPFolder imapFolder = createIMAPFolder(f); imapFolders.add(imapFolder); walkFolders(f, imapFolder); } // Create the tree and return the result FetchFoldersResult fetchFolderResult = new FetchFoldersResult(imapFolders); logger.debug("Fetching folders for user: " + user + " returns:\n" + fetchFolderResult.toString()); return fetchFolderResult; } catch (Exception e) { e.printStackTrace(); logger.error("Unable to get folders for User " + user,e); throw new ActionException("Unable to get folders for User " + user); } }
/** * Delete this folder. */ public synchronized boolean delete(boolean recurse) throws MessagingException { checkClosed(); // insure that this folder is closed. if (recurse) { // Delete all subfolders. Folder[] f = list(); for (int i = 0; i < f.length; i++) f[i].delete(recurse); // ignore intermediate failures } // Attempt to delete this folder Object ret = doCommandIgnoreFailure(new ProtocolCommand() { public Object doCommand(IMAPProtocol p) throws ProtocolException { p.delete(fullName); return Boolean.TRUE; } }); if (ret == null) // Non-existent folder/No permission ?? return false; // DELETE succeeded. exists = false; attributes = null; // Notify listeners on self and our Store notifyFolderListeners(FolderEvent.DELETED); return true; }
Folder[] f = list(); for (int i = 0; i < f.length; i++)
/** * Delete this folder. */ public synchronized boolean delete(boolean recurse) throws MessagingException { checkClosed(); // insure that this folder is closed. if (recurse) { // Delete all subfolders. Folder[] f = list(); for (int i = 0; i < f.length; i++) f[i].delete(recurse); // ignore intermediate failures } // Attempt to delete this folder Object ret = doCommandIgnoreFailure(new ProtocolCommand() { public Object doCommand(IMAPProtocol p) throws ProtocolException { p.delete(fullName); return Boolean.TRUE; } }); if (ret == null) // Non-existent folder/No permission ?? return false; // DELETE succeeded. exists = false; attributes = null; // Notify listeners on self and our Store notifyFolderListeners(FolderEvent.DELETED); return true; }
Folder[] f = list(); for (int i = 0; i < f.length; i++)
Folder[] f = list(); for (int i = 0; i < f.length; i++)
Folder[] f = list(); for (int i = 0; i < f.length; i++)