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