aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-11-20 22:02:32 +0100
committeriNPUTmice <daniel@gultsch.de>2014-11-20 22:02:32 +0100
commit66abdfccd4f7e3117bc60434657bc005434ee3b4 (patch)
tree3be3d2eaa1a5bb05959685ef686e4df5bcce840e
parent8fe3b2974b9e75975bee987d5ab179a433535fb6 (diff)
create file and dirs before creating file
-rw-r--r--src/main/java/eu/siacs/conversations/persistance/FileBackend.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java
index 9683d38d..7bac3fd0 100644
--- a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java
+++ b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java
@@ -149,6 +149,8 @@ public class FileBackend {
String extension = MimeTypeMap.getSingleton().getExtensionFromMimeType(mime);
message.setRelativeFilePath(message.getUuid() + "." + extension);
DownloadableFile file = mXmppConnectionService.getFileBackend().getFile(message);
+ file.getParentFile().mkdirs();
+ file.createNewFile();
OutputStream os = new FileOutputStream(file);
InputStream is = mXmppConnectionService.getContentResolver().openInputStream(uri);
byte[] buffer = new byte[1024];