Fix missing directories

This commit is contained in:
serso 2016-03-15 17:46:08 +01:00
parent 539be7399c
commit 3106403a86

View File

@ -24,6 +24,10 @@ public class FileSaver extends BaseIoSaver {
@NonNull @NonNull
protected FileOutputStream getOutputStream() throws FileNotFoundException { protected FileOutputStream getOutputStream() throws FileNotFoundException {
final File dir = file.getParentFile();
if (dir != null && !dir.exists()) {
dir.mkdirs();
}
return new FileOutputStream(file); return new FileOutputStream(file);
} }
} }