- private File getAttachmentPreviewFile(SignalServiceAttachmentRemoteId attachmentId) {
- return new File(attachmentsPath, attachmentId.toString() + ".preview");
+ private File getAttachmentPreviewFile(
+ SignalServiceAttachmentRemoteId attachmentId, Optional<String> filename, Optional<String> contentType
+ ) {
+ final var extension = getAttachmentExtension(filename, contentType);
+ return new File(attachmentsPath, attachmentId.toString() + extension + ".preview");
+ }
+
+ private File getAttachmentFile(
+ SignalServiceAttachmentRemoteId attachmentId, Optional<String> filename, Optional<String> contentType
+ ) {
+ final var extension = getAttachmentExtension(filename, contentType);
+ return new File(attachmentsPath, attachmentId.toString() + extension);