mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-23 18:02:15 -05:00
Added error logging
This commit is contained in:
parent
d791770154
commit
13b74d0d9e
@ -81,14 +81,15 @@ public class StorageExporter {
|
|||||||
throws StorageImportExportException {
|
throws StorageImportExportException {
|
||||||
|
|
||||||
OutputStream os = null;
|
OutputStream os = null;
|
||||||
|
String filename = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
File dir = new File(Environment.getExternalStorageDirectory() + File.separator
|
File dir = new File(Environment.getExternalStorageDirectory() + File.separator
|
||||||
+ context.getPackageName());
|
+ context.getPackageName());
|
||||||
dir.mkdirs();
|
dir.mkdirs();
|
||||||
File file = Utility.createUniqueFile(dir, EXPORT_FILENAME);
|
File file = Utility.createUniqueFile(dir, EXPORT_FILENAME);
|
||||||
String fileName = file.getAbsolutePath();
|
filename = file.getAbsolutePath();
|
||||||
os = new FileOutputStream(fileName);
|
os = new FileOutputStream(filename);
|
||||||
|
|
||||||
if (encryptionKey == null) {
|
if (encryptionKey == null) {
|
||||||
exportPreferences(context, os, includeGlobals, accountUuids);
|
exportPreferences(context, os, includeGlobals, accountUuids);
|
||||||
@ -98,14 +99,16 @@ public class StorageExporter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If all went well, we return the name of the file just written.
|
// If all went well, we return the name of the file just written.
|
||||||
return fileName;
|
return filename;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new StorageImportExportException(e);
|
throw new StorageImportExportException(e);
|
||||||
} finally {
|
} finally {
|
||||||
if (os != null) {
|
if (os != null) {
|
||||||
try {
|
try {
|
||||||
os.close();
|
os.close();
|
||||||
} catch (IOException ioe) {}
|
} catch (IOException ioe) {
|
||||||
|
Log.w(K9.LOG_TAG, "Couldn't close exported settings file: " + filename);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user