aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/persistance
diff options
context:
space:
mode:
authorChristian Schneppe <christian.schneppe@pix-art.de>2020-01-02 09:43:51 +0100
committerChristian Schneppe <christian.schneppe@pix-art.de>2020-01-02 09:43:51 +0100
commit8ca04b46e6663e2956fcd82785714ca3c93d1377 (patch)
tree17b0ecc5fe53ed682e6c2d958de494137c65e69c /src/main/java/de/pixart/messenger/persistance
parenta5f52ef599ae5519bd704fae8ceb1dd78c7edcc6 (diff)
persist file size across aborts
Diffstat (limited to 'src/main/java/de/pixart/messenger/persistance')
-rw-r--r--src/main/java/de/pixart/messenger/persistance/FileBackend.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/persistance/FileBackend.java b/src/main/java/de/pixart/messenger/persistance/FileBackend.java
index a074eca4f..c6d6448af 100644
--- a/src/main/java/de/pixart/messenger/persistance/FileBackend.java
+++ b/src/main/java/de/pixart/messenger/persistance/FileBackend.java
@@ -49,7 +49,6 @@ import java.net.URL;
import java.security.DigestOutputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
-import java.security.acl.LastOwnerException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
@@ -1167,6 +1166,12 @@ public class FileBackend {
message.setType(privateMessage ? Message.TYPE_PRIVATE_FILE : (image ? Message.TYPE_IMAGE : Message.TYPE_FILE));
}
+ public static void updateFileParams(Message message, URL url, long size) {
+ final StringBuilder body = new StringBuilder();
+ body.append(url.toString()).append('|').append(size);
+ message.setBody(body.toString());
+ }
+
private int getMediaRuntime(File file) {
try {
MediaMetadataRetriever mediaMetadataRetriever = new MediaMetadataRetriever();