mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-11 18:29:05 +01:00
Use attachment header to retrieve attachment.
This commit is contained in:
@@ -1,15 +1,27 @@
|
||||
package org.briarproject.briar.api.messaging;
|
||||
|
||||
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
import javax.annotation.concurrent.Immutable;
|
||||
|
||||
@Immutable
|
||||
@NotNullByDefault
|
||||
public class Attachment {
|
||||
|
||||
private final AttachmentHeader header;
|
||||
private final InputStream stream;
|
||||
|
||||
public Attachment(InputStream stream) {
|
||||
public Attachment(AttachmentHeader header, InputStream stream) {
|
||||
this.header = header;
|
||||
this.stream = stream;
|
||||
}
|
||||
|
||||
public AttachmentHeader getHeader() {
|
||||
return header;
|
||||
}
|
||||
|
||||
public InputStream getStream() {
|
||||
return stream;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public interface MessagingManager extends ConversationClient {
|
||||
/**
|
||||
* Stores a local attachment message.
|
||||
*
|
||||
* @throws FileTooBigException
|
||||
* @throws FileTooBigException If the attachment is too big
|
||||
*/
|
||||
AttachmentHeader addLocalAttachment(GroupId groupId, long timestamp,
|
||||
String contentType, InputStream is) throws DbException, IOException;
|
||||
@@ -68,9 +68,9 @@ public interface MessagingManager extends ConversationClient {
|
||||
String getMessageText(MessageId m) throws DbException;
|
||||
|
||||
/**
|
||||
* Returns the attachment with the given ID.
|
||||
* Returns the attachment with the given message ID and content type.
|
||||
*/
|
||||
Attachment getAttachment(MessageId m) throws DbException;
|
||||
Attachment getAttachment(AttachmentHeader h) throws DbException;
|
||||
|
||||
/**
|
||||
* Returns true if the contact with the given {@link ContactId} does support
|
||||
|
||||
Reference in New Issue
Block a user