mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
Code cleanups, javadoc.
This commit is contained in:
@@ -59,7 +59,7 @@ class AttachmentCreationTask {
|
||||
}
|
||||
|
||||
@IoExecutor
|
||||
public void storeAttachments() {
|
||||
void storeAttachments() {
|
||||
for (Uri uri: uris) processUri(uri);
|
||||
AttachmentCreator attachmentCreator = this.attachmentCreator;
|
||||
if (!canceled && attachmentCreator != null)
|
||||
|
||||
@@ -111,14 +111,14 @@ public class AttachmentCreator {
|
||||
}
|
||||
|
||||
@IoExecutor
|
||||
void onAttachmentError(Uri uri, Throwable t) {
|
||||
void onAttachmentError(Uri uri, Exception e) {
|
||||
// get error message
|
||||
String errorMsg;
|
||||
if (t instanceof UnsupportedMimeTypeException) {
|
||||
String mimeType = ((UnsupportedMimeTypeException) t).getMimeType();
|
||||
if (e instanceof UnsupportedMimeTypeException) {
|
||||
String mimeType = ((UnsupportedMimeTypeException) e).getMimeType();
|
||||
errorMsg = app.getString(
|
||||
R.string.image_attach_error_invalid_mime_type, mimeType);
|
||||
} else if (t instanceof FileTooBigException) {
|
||||
} else if (e instanceof FileTooBigException) {
|
||||
int mb = MAX_IMAGE_SIZE / 1024 / 1024;
|
||||
errorMsg = app.getString(R.string.image_attach_error_too_big, mb);
|
||||
} else {
|
||||
|
||||
@@ -47,6 +47,7 @@ public class AttachmentRetriever {
|
||||
|
||||
private static final Logger LOG =
|
||||
getLogger(AttachmentRetriever.class.getName());
|
||||
|
||||
private static final int READ_LIMIT = 1024 * 8192;
|
||||
|
||||
private final MessagingManager messagingManager;
|
||||
|
||||
@@ -2,5 +2,8 @@ package org.briarproject.briar.api.messaging;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* An exception that is thrown when a file is too big to attach to a message.
|
||||
*/
|
||||
public class FileTooBigException extends IOException {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user