use of com.fsck.k9.mailstore.LocalStore in project k-9 by k9mail.
the class AttachmentProvider method getType.
private String getType(String accountUuid, String id, String mimeType) {
String type;
final Account account = Preferences.getPreferences(getContext()).getAccount(accountUuid);
try {
final LocalStore localStore = LocalStore.getInstance(account, getContext());
AttachmentInfo attachmentInfo = localStore.getAttachmentInfo(id);
if (mimeType != null) {
type = mimeType;
} else {
type = attachmentInfo.type;
}
} catch (MessagingException e) {
Timber.e(e, "Unable to retrieve LocalStore for %s", account);
type = MimeUtility.DEFAULT_ATTACHMENT_MIME_TYPE;
}
return type;
}
use of com.fsck.k9.mailstore.LocalStore in project k-9 by k9mail.
the class SqlQueryBuilder method getFolderId.
private static long getFolderId(Account account, String folderName) {
long folderId = 0;
try {
LocalStore localStore = account.getLocalStore();
LocalFolder folder = localStore.getFolder(folderName);
folder.open(Folder.OPEN_MODE_RO);
folderId = folder.getId();
} catch (MessagingException e) {
//FIXME
e.printStackTrace();
}
return folderId;
}
Aggregations