MCPcopy Create free account
hub / github.com/M66B/FairEmail / delete

Method delete

app/src/main/java/com/sun/mail/imap/IMAPFolder.java:910–943  ·  view source on GitHub ↗

Delete this folder.

(boolean recurse)

Source from the content-addressed store, hash-verified

908 * Delete this folder.
909 */
910 @Override
911 public synchronized boolean delete(boolean recurse)
912 throws MessagingException {
913 checkClosed(); // insure that this folder is closed.
914
915 if (recurse) {
916 // Delete all subfolders.
917 Folder[] f = list();
918 for (int i = 0; i < f.length; i++)
919 f[i].delete(recurse); // ignore intermediate failures
920 }
921
922 // Attempt to delete this folder
923
924 Object ret = doCommandIgnoreFailure(new ProtocolCommand() {
925 @Override
926 public Object doCommand(IMAPProtocol p) throws ProtocolException {
927 p.delete(fullName);
928 return Boolean.TRUE;
929 }
930 });
931
932 if (ret == null)
933 // Non-existent folder/No permission ??
934 return false;
935
936 // DELETE succeeded.
937 exists = false;
938 attributes = null;
939
940 // Notify listeners on self and our Store
941 notifyFolderListeners(FolderEvent.DELETED);
942 return true;
943 }
944
945 /**
946 * Rename this folder.

Callers 1

doCommandMethod · 0.45

Calls 4

checkClosedMethod · 0.95
listMethod · 0.95
notifyFolderListenersMethod · 0.45

Tested by

no test coverage detected