Skip to content

Various fixes #156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Nov 28, 2016
Prev Previous commit
Remove error if the directory already exists
  • Loading branch information
BlooJeans committed Nov 22, 2016
commit 74b27aa65d918ae2be06b2e606e51dc9c1bc3bd0
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,7 @@ public void doInBackground(StreamDownloadTask.TaskSnapshot taskSnapshot, InputSt
String pathMinusFileName = indexOfLastSlash>0 ? localFile.substring(0, indexOfLastSlash) + "/" : "/";
String filename = indexOfLastSlash>0 ? localFile.substring(indexOfLastSlash+1) : localFile;
File fileWithJustPath = new File(pathMinusFileName);
if (!fileWithJustPath.mkdirs()) {
Log.e(TAG, "Directory not created");
WritableMap error = Arguments.createMap();
error.putString("message", "Directory not created");
callback.invoke(error);
return;
}
fileWithJustPath.mkdirs();
File fileWithFullPath = new File(pathMinusFileName, filename);
FileOutputStream output = new FileOutputStream(fileWithFullPath);
int bufferSize = 1024;
Expand Down