/** * Check for an IMAP login REFERRAL response code. * * @exception IMAPReferralException if REFERRAL response code found * @see "RFC 2221" */ private void checkReferral(Response r) throws IMAPReferralException { String s = r.getRest(); // get the text after the response if (s.startsWith("[")) { // a response code int i = s.indexOf(' '); if (i > 0 && s.substring(1, i).equalsIgnoreCase("REFERRAL")) { String url, msg; int j = s.indexOf(']'); if (j > 0) { // should always be true; url = s.substring(i + 1, j); msg = s.substring(j + 1).trim(); } else { url = s.substring(i + 1); msg = ""; } if (r.isBYE()) disconnect(); throw new IMAPReferralException(msg, url); } } }
/** * Check for an IMAP login REFERRAL response code. * * @exception IMAPReferralException if REFERRAL response code found * @see "RFC 2221" */ private void checkReferral(Response r) throws IMAPReferralException { String s = r.getRest(); // get the text after the response if (s.startsWith("[")) { // a response code int i = s.indexOf(' '); if (i > 0 && s.substring(1, i).equalsIgnoreCase("REFERRAL")) { String url, msg; int j = s.indexOf(']'); if (j > 0) { // should always be true; url = s.substring(i + 1, j); msg = s.substring(j + 1).trim(); } else { url = s.substring(i + 1); msg = ""; } if (r.isBYE()) disconnect(); throw new IMAPReferralException(msg, url); } } }
/** * Handle notifications and alerts. * Response must be an OK, NO, BAD, or BYE response. */ void handleResponseCode(Response r) { if (enableResponseEvents) notifyStoreListeners(IMAPStore.RESPONSE, r.toString()); String s = r.getRest(); // get the text after the response boolean isAlert = false; if (s.startsWith("[")) { // a response code int i = s.indexOf(']'); // remember if it's an alert if (i > 0 && s.substring(0, i + 1).equalsIgnoreCase("[ALERT]")) isAlert = true; // strip off the response code in any event s = s.substring(i + 1).trim(); } if (isAlert) notifyStoreListeners(StoreEvent.ALERT, s); else if (r.isUnTagged() && s.length() > 0) // Only send notifications that come with untagged // responses, and only if there is actually some // text there. notifyStoreListeners(StoreEvent.NOTICE, s); }
/** * Handle notifications and alerts. * Response must be an OK, NO, BAD, or BYE response. */ void handleResponseCode(Response r) { if (enableResponseEvents) notifyStoreListeners(IMAPStore.RESPONSE, r.toString()); String s = r.getRest(); // get the text after the response boolean isAlert = false; if (s.startsWith("[")) { // a response code int i = s.indexOf(']'); // remember if it's an alert if (i > 0 && s.substring(0, i + 1).equalsIgnoreCase("[ALERT]")) isAlert = true; // strip off the response code in any event s = s.substring(i + 1).trim(); } if (isAlert) notifyStoreListeners(StoreEvent.ALERT, s); else if (r.isUnTagged() && s.length() > 0) // Only send notifications that come with untagged // responses, and only if there is actually some // text there. notifyStoreListeners(StoreEvent.NOTICE, s); }
first = false; } else { s = ntlm.generateType3Msg(r.getRest());
first = false; } else { s = ntlm.generateType3Msg(r.getRest());
Response r = cex.getResponse(); throw new AuthenticationFailedException( r != null ? r.getRest() : cex.getMessage()); } catch (ProtocolException pex) { // any other exception
Response r = cex.getResponse(); throw new AuthenticationFailedException( r != null ? r.getRest() : cex.getMessage()); } catch (ProtocolException pex) { // any other exception
/** * Handle notifications and alerts. * Response must be an OK, NO, BAD, or BYE response. */ void handleResponseCode(Response r) { String s = r.getRest(); // get the text after the response boolean isAlert = false; if (s.startsWith("[")) { // a response code int i = s.indexOf(']'); // remember if it's an alert if (i > 0 && s.substring(0, i + 1).equalsIgnoreCase("[ALERT]")) isAlert = true; // strip off the response code in any event s = s.substring(i + 1).trim(); } if (isAlert) notifyStoreListeners(StoreEvent.ALERT, s); else if (r.isUnTagged() && s.length() > 0) // Only send notifications that come with untagged // responses, and only if there is actually some // text there. notifyStoreListeners(StoreEvent.NOTICE, s); }
/** * Check for an IMAP login REFERRAL response code. * * @exception IMAPReferralException if REFERRAL response code found * @see "RFC 2221" */ private void checkReferral(Response r) throws IMAPReferralException { String s = r.getRest(); // get the text after the response if (s.startsWith("[")) { // a response code int i = s.indexOf(' '); if (i > 0 && s.substring(1, i).equalsIgnoreCase("REFERRAL")) { String url, msg; int j = s.indexOf(']'); if (j > 0) { // should always be true; url = s.substring(i + 1, j); msg = s.substring(j + 1).trim(); } else { url = s.substring(i + 1); msg = ""; } if (r.isBYE()) disconnect(); throw new IMAPReferralException(msg, url); } } }
/** * Check for an IMAP login REFERRAL response code. * * @exception IMAPReferralException if REFERRAL response code found * @see "RFC 2221" */ private void checkReferral(Response r) throws IMAPReferralException { String s = r.getRest(); // get the text after the response if (s.startsWith("[")) { // a response code int i = s.indexOf(' '); if (i > 0 && s.substring(1, i).equalsIgnoreCase("REFERRAL")) { String url, msg; int j = s.indexOf(']'); if (j > 0) { // should always be true; url = s.substring(i + 1, j); msg = s.substring(j + 1).trim(); } else { url = s.substring(i + 1); msg = ""; } if (r.isBYE()) disconnect(); throw new IMAPReferralException(msg, url); } } }
/** * Check for an IMAP login REFERRAL response code. * * @exception IMAPReferralException if REFERRAL response code found * @see "RFC 2221" */ private void checkReferral(Response r) throws IMAPReferralException { String s = r.getRest(); // get the text after the response if (s.startsWith("[")) { // a response code int i = s.indexOf(' '); if (i > 0 && s.substring(1, i).equalsIgnoreCase("REFERRAL")) { String url, msg; int j = s.indexOf(']'); if (j > 0) { // should always be true; url = s.substring(i + 1, j); msg = s.substring(j + 1).trim(); } else { url = s.substring(i + 1); msg = ""; } if (r.isBYE()) disconnect(); throw new IMAPReferralException(msg, url); } } }
/** * Handle notifications and alerts. * Response must be an OK, NO, BAD, or BYE response. */ void handleResponseCode(Response r) { String s = r.getRest(); // get the text after the response boolean isAlert = false; if (s.startsWith("[")) { // a response code int i = s.indexOf(']'); // remember if it's an alert if (i > 0 && s.substring(0, i + 1).equalsIgnoreCase("[ALERT]")) isAlert = true; // strip off the response code in any event s = s.substring(i + 1).trim(); } if (isAlert) notifyStoreListeners(StoreEvent.ALERT, s); else if (r.isUnTagged() && s.length() > 0) // Only send notifications that come with untagged // responses, and only if there is actually some // text there. notifyStoreListeners(StoreEvent.NOTICE, s); } }
/** * Check for an IMAP login REFERRAL response code. * * @exception IMAPReferralException if REFERRAL response code found * @see "RFC 2221" */ private void checkReferral(Response r) throws IMAPReferralException { String s = r.getRest(); // get the text after the response if (s.startsWith("[")) { // a response code int i = s.indexOf(' '); if (i > 0 && s.substring(1, i).equalsIgnoreCase("REFERRAL")) { String url, msg; int j = s.indexOf(']'); if (j > 0) { // should always be true; url = s.substring(i + 1, j); msg = s.substring(j + 1).trim(); } else { url = s.substring(i + 1); msg = ""; } if (r.isBYE()) disconnect(); throw new IMAPReferralException(msg, url); } } }
/** * Handle notifications and alerts. * Response must be an OK, NO, BAD, or BYE response. */ void handleResponseCode(Response r) { if (enableResponseEvents) notifyStoreListeners(IMAPStore.RESPONSE, r.toString()); String s = r.getRest(); // get the text after the response boolean isAlert = false; if (s.startsWith("[")) { // a response code int i = s.indexOf(']'); // remember if it's an alert if (i > 0 && s.substring(0, i + 1).equalsIgnoreCase("[ALERT]")) isAlert = true; // strip off the response code in any event s = s.substring(i + 1).trim(); } if (isAlert) notifyStoreListeners(StoreEvent.ALERT, s); else if (r.isUnTagged() && s.length() > 0) // Only send notifications that come with untagged // responses, and only if there is actually some // text there. notifyStoreListeners(StoreEvent.NOTICE, s); }
/** * Handle notifications and alerts. * Response must be an OK, NO, BAD, or BYE response. */ void handleResponseCode(Response r) { if (enableResponseEvents) notifyStoreListeners(IMAPStore.RESPONSE, r.toString()); String s = r.getRest(); // get the text after the response boolean isAlert = false; if (s.startsWith("[")) { // a response code int i = s.indexOf(']'); // remember if it's an alert if (i > 0 && s.substring(0, i + 1).equalsIgnoreCase("[ALERT]")) isAlert = true; // strip off the response code in any event s = s.substring(i + 1).trim(); } if (isAlert) notifyStoreListeners(StoreEvent.ALERT, s); else if (r.isUnTagged() && s.length() > 0) // Only send notifications that come with untagged // responses, and only if there is actually some // text there. notifyStoreListeners(StoreEvent.NOTICE, s); }
/** * Handle notifications and alerts. * Response must be an OK, NO, BAD, or BYE response. */ void handleResponseCode(Response r) { if (enableResponseEvents) notifyStoreListeners(IMAPStore.RESPONSE, r.toString()); String s = r.getRest(); // get the text after the response boolean isAlert = false; if (s.startsWith("[")) { // a response code int i = s.indexOf(']'); // remember if it's an alert if (i > 0 && s.substring(0, i + 1).equalsIgnoreCase("[ALERT]")) isAlert = true; // strip off the response code in any event s = s.substring(i + 1).trim(); } if (isAlert) notifyStoreListeners(StoreEvent.ALERT, s); else if (r.isUnTagged() && s.length() > 0) // Only send notifications that come with untagged // responses, and only if there is actually some // text there. notifyStoreListeners(StoreEvent.NOTICE, s); }
/** * Handle notifications and alerts. * Response must be an OK, NO, BAD, or BYE response. */ void handleResponseCode(Response r) { if (enableResponseEvents) notifyStoreListeners(IMAPStore.RESPONSE, r.toString()); String s = r.getRest(); // get the text after the response boolean isAlert = false; if (s.startsWith("[")) { // a response code int i = s.indexOf(']'); // remember if it's an alert if (i > 0 && s.substring(0, i + 1).equalsIgnoreCase("[ALERT]")) isAlert = true; // strip off the response code in any event s = s.substring(i + 1).trim(); } if (isAlert) notifyStoreListeners(StoreEvent.ALERT, s); else if (r.isUnTagged() && s.length() > 0) // Only send notifications that come with untagged // responses, and only if there is actually some // text there. notifyStoreListeners(StoreEvent.NOTICE, s); }
protocol = null; throw new AuthenticationFailedException( cex.getResponse().getRest()); } catch (ProtocolException pex) { // any other exception throw new MessagingException(pex.getMessage(), pex);
first = false; } else { s = ntlm.generateType3Msg(r.getRest());