use of com.android.voicemail.impl.mail.store.ImapStore.ImapException in project android_packages_apps_Dialer by LineageOS.
the class ImapConnection method getCommandResponses.
/**
* Read and return all of the responses from the most recent command sent to the server
*
* @return a list of ImapResponses
* @throws IOException
* @throws MessagingException
*/
List<ImapResponse> getCommandResponses() throws IOException, MessagingException {
final List<ImapResponse> responses = new ArrayList<ImapResponse>();
ImapResponse response;
do {
response = parser.readResponse(false);
responses.add(response);
} while (!(response.isTagged() || response.isContinuationRequest()));
if (!(response.isOk() || response.isContinuationRequest())) {
final String toString = response.toString();
final String status = response.getStatusOrEmpty().getString();
final String statusMessage = response.getStatusResponseTextOrEmpty().getString();
final String alert = response.getAlertTextOrEmpty().getString();
final String responseCode = response.getResponseCodeOrEmpty().getString();
destroyResponses();
throw new ImapException(toString, status, statusMessage, alert, responseCode);
}
return responses;
}
use of com.android.voicemail.impl.mail.store.ImapStore.ImapException in project android_packages_apps_Dialer by MoKee.
the class ImapFolder method searchForUids.
@VisibleForTesting
String[] searchForUids(String searchCriteria) throws MessagingException {
checkOpen();
try {
try {
final String command = ImapConstants.UID_SEARCH + " " + searchCriteria;
final String[] result = getSearchUids(connection.executeSimpleCommand(command));
VvmLog.d(TAG, "searchForUids '" + searchCriteria + "' results: " + result.length);
return result;
} catch (ImapException me) {
VvmLog.d(TAG, "ImapException in search: " + searchCriteria, me);
// Not found
return Utility.EMPTY_STRINGS;
} catch (IOException ioe) {
VvmLog.d(TAG, "IOException in search: " + searchCriteria, ioe);
store.getImapHelper().handleEvent(OmtpEvents.DATA_GENERIC_IMAP_IOE);
throw ioExceptionHandler(connection, ioe);
}
} finally {
destroyResponses();
}
}
use of com.android.voicemail.impl.mail.store.ImapStore.ImapException in project android_packages_apps_Dialer by LineageOS.
the class ImapFolder method searchForUids.
@VisibleForTesting
String[] searchForUids(String searchCriteria) throws MessagingException {
checkOpen();
try {
try {
final String command = ImapConstants.UID_SEARCH + " " + searchCriteria;
final String[] result = getSearchUids(connection.executeSimpleCommand(command));
VvmLog.d(TAG, "searchForUids '" + searchCriteria + "' results: " + result.length);
return result;
} catch (ImapException me) {
VvmLog.d(TAG, "ImapException in search: " + searchCriteria, me);
// Not found
return Utility.EMPTY_STRINGS;
} catch (IOException ioe) {
VvmLog.d(TAG, "IOException in search: " + searchCriteria, ioe);
store.getImapHelper().handleEvent(OmtpEvents.DATA_GENERIC_IMAP_IOE);
throw ioExceptionHandler(connection, ioe);
}
} finally {
destroyResponses();
}
}
use of com.android.voicemail.impl.mail.store.ImapStore.ImapException in project android_packages_apps_Dialer by MoKee.
the class ImapConnection method getCommandResponses.
/**
* Read and return all of the responses from the most recent command sent to the server
*
* @return a list of ImapResponses
* @throws IOException
* @throws MessagingException
*/
List<ImapResponse> getCommandResponses() throws IOException, MessagingException {
final List<ImapResponse> responses = new ArrayList<ImapResponse>();
ImapResponse response;
do {
response = parser.readResponse(false);
responses.add(response);
} while (!(response.isTagged() || response.isContinuationRequest()));
if (!(response.isOk() || response.isContinuationRequest())) {
final String toString = response.toString();
final String status = response.getStatusOrEmpty().getString();
final String statusMessage = response.getStatusResponseTextOrEmpty().getString();
final String alert = response.getAlertTextOrEmpty().getString();
final String responseCode = response.getResponseCodeOrEmpty().getString();
destroyResponses();
throw new ImapException(toString, status, statusMessage, alert, responseCode);
}
return responses;
}
Aggregations