From 4614ff343eda9d15eae01493be833d6c0be05d7a Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Mon, 3 Nov 2014 20:55:31 +0100 Subject: create file explicitly before downloading image --- src/main/java/eu/siacs/conversations/http/HttpConnection.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/main/java/eu/siacs/conversations/http/HttpConnection.java b/src/main/java/eu/siacs/conversations/http/HttpConnection.java index 24eb5ed3..147ac42f 100644 --- a/src/main/java/eu/siacs/conversations/http/HttpConnection.java +++ b/src/main/java/eu/siacs/conversations/http/HttpConnection.java @@ -229,6 +229,8 @@ public class HttpConnection implements Downloadable { connection.connect(); BufferedInputStream is = new BufferedInputStream( connection.getInputStream()); + file.getParentFile().mkdirs(); + file.createNewFile(); OutputStream os = file.createOutputStream(); if (os == null) { throw new IOException(); -- cgit v1.2.3