diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-11-20 22:02:32 +0100 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-11-20 22:02:32 +0100 |
commit | 66abdfccd4f7e3117bc60434657bc005434ee3b4 (patch) | |
tree | 3be3d2eaa1a5bb05959685ef686e4df5bcce840e /src | |
parent | 8fe3b2974b9e75975bee987d5ab179a433535fb6 (diff) |
create file and dirs before creating file
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/persistance/FileBackend.java | 2 |
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]; |