Merge pull request #5820 from cketti/fix_export_overwriting_file
Truncate existing file when exporting OPML/HTML/Favorites
This commit is contained in:
commit
0e55ff2c30
|
@ -36,7 +36,7 @@ public class DocumentFileExportWorker {
|
|||
OutputStreamWriter writer = null;
|
||||
try {
|
||||
Uri uri = output.getUri();
|
||||
outputStream = context.getContentResolver().openOutputStream(uri);
|
||||
outputStream = context.getContentResolver().openOutputStream(uri, "wt");
|
||||
if (outputStream == null) {
|
||||
throw new IOException();
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ public class DatabaseExporter {
|
|||
ParcelFileDescriptor pfd = null;
|
||||
FileOutputStream fileOutputStream = null;
|
||||
try {
|
||||
pfd = context.getContentResolver().openFileDescriptor(uri, "w");
|
||||
pfd = context.getContentResolver().openFileDescriptor(uri, "wt");
|
||||
fileOutputStream = new FileOutputStream(pfd.getFileDescriptor());
|
||||
exportToStream(fileOutputStream, context);
|
||||
} catch (IOException e) {
|
||||
|
|
Loading…
Reference in New Issue