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

Method checkRange

app/src/main/java/com/sun/mail/imap/IMAPFolder.java:472–495  ·  view source on GitHub ↗
(int msgno)

Source from the content-addressed store, hash-verified

470 * pending new message notifications from the server.
471 */
472 protected void checkRange(int msgno) throws MessagingException {
473 if (msgno < 1) // message-numbers start at 1
474 throw new IndexOutOfBoundsException("message number < 1");
475
476 if (msgno <= total)
477 return;
478
479 // Out of range, let's ping the server and see if
480 // the server has more messages for us.
481
482 synchronized(messageCacheLock) { // Acquire lock
483 try {
484 keepConnectionAlive(false);
485 } catch (ConnectionException cex) {
486 // Oops, lost connection
487 throw new FolderClosedException(this, cex.getMessage());
488 } catch (ProtocolException pex) {
489 throw new MessagingException(pex.getMessage(), pex);
490 }
491 } // Release lock
492
493 if (msgno > total) // Still out of range ? Throw up ...
494 throw new IndexOutOfBoundsException(msgno + " > " + total);
495 }
496
497 /*
498 * Check whether the given flags are supported by this server,

Callers 1

getMessageMethod · 0.95

Calls 2

keepConnectionAliveMethod · 0.95
getMessageMethod · 0.65

Tested by

no test coverage detected