create file explicitly before downloading image

This commit is contained in:
iNPUTmice 2014-11-03 20:55:31 +01:00
parent 962008fec8
commit 4614ff343e

View File

@ -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();