public Message getMessage(int messageNumber) throws MessagingException {
if (!isOpen()) throw new IllegalStateException("Folder is closed.");
if (!exists()) throw new FolderNotFoundException(this);
if (ROOT.equals(getName())) {
throw new MethodNotSupportedException("getMessage");
}
synchronized (this) {
int index = messageNumber - 1;
ExchangeMessage message = cache.get(index);
if (message == null) {