parent
352418d2d7
commit
b1bf33b13b
1 changed files with 7 additions and 3 deletions
|
@ -59,10 +59,14 @@ public class SaveAttachmentTask extends ProgressDialogAsyncTask<SaveAttachmentTa
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
File mediaFile = constructOutputFile(attachment.contentType, attachment.date);
|
File mediaFile = constructOutputFile(attachment.contentType, attachment.date);
|
||||||
InputStream inputStream = PartAuthority.getPartStream(context, masterSecret, attachment.uri);
|
InputStream inputStream = PartAuthority.getPartStream(context, masterSecret, attachment.uri);
|
||||||
OutputStream outputStream = new FileOutputStream(mediaFile);
|
|
||||||
|
|
||||||
|
if (inputStream == null) {
|
||||||
|
return FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
OutputStream outputStream = new FileOutputStream(mediaFile);
|
||||||
Util.copy(inputStream, outputStream);
|
Util.copy(inputStream, outputStream);
|
||||||
|
|
||||||
MediaScannerConnection.scanFile(context, new String[]{mediaFile.getAbsolutePath()},
|
MediaScannerConnection.scanFile(context, new String[]{mediaFile.getAbsolutePath()},
|
||||||
|
|
Loading…
Add table
Reference in a new issue