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

Method renameTo

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

Rename this folder.

(final Folder f)

Source from the content-addressed store, hash-verified

946 * Rename this folder.
947 */
948 @Override
949 public synchronized boolean renameTo(final Folder f)
950 throws MessagingException {
951 checkClosed(); // insure that we are closed.
952 checkExists();
953 if (f.getStore() != store)
954 throw new MessagingException("Can't rename across Stores");
955
956
957 Object ret = doCommandIgnoreFailure(new ProtocolCommand() {
958 @Override
959 public Object doCommand(IMAPProtocol p) throws ProtocolException {
960 p.rename(fullName, f.getFullName());
961 return Boolean.TRUE;
962 }
963 });
964
965 if (ret == null)
966 return false;
967
968 exists = false;
969 attributes = null;
970 notifyFolderRenamedListeners(f);
971 return true;
972 }
973
974 /**
975 * Open this folder in the given mode.

Callers

nothing calls this directly

Calls 5

checkClosedMethod · 0.95
checkExistsMethod · 0.95
getStoreMethod · 0.45

Tested by

no test coverage detected