Rename this folder.
(final Folder f)
| 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. |
nothing calls this directly
no test coverage detected