Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

handle IOExceptions when creating the VirtualFileSystem

  • Loading branch information...
commit 5d7e1997ae24c123263a6275f8cdc13abcce89ad 1 parent 943dfb0
@eighthave eighthave authored
View
11 src/info/guardianproject/test/iocipher/FileTest.java
@@ -23,10 +23,17 @@
protected void setUp() {
java.io.File db = new java.io.File(mContext.getDir("vfs",
- Context.MODE_PRIVATE).getAbsoluteFile(), "sqlcipherfs.db");
+ Context.MODE_PRIVATE).getAbsoluteFile(), TAG + ".db");
if (db.exists())
db.delete();
- vfs = new VirtualFileSystem(db.getAbsolutePath());
+ Log.v(TAG, "database file: " + db.getAbsolutePath());
+ if (db.exists())
+ Log.v(TAG, "exists: " + db.getAbsolutePath());
+ try {
+ vfs = new VirtualFileSystem(db.getAbsolutePath());
+ } catch (Exception e) {
+ Log.e(TAG, e.toString());
+ }
vfs.mount();
}
View
8 src/info/guardianproject/test/iocipher/VirtualFileSystemTest.java
@@ -13,10 +13,14 @@
protected void setUp() {
java.io.File db = new java.io.File(mContext.getDir("vfs",
- Context.MODE_PRIVATE).getAbsoluteFile(), "sqlcipherfs.db");
+ Context.MODE_PRIVATE).getAbsoluteFile(), TAG + ".db");
if (db.exists())
db.delete();
- vfs = new VirtualFileSystem(db.getAbsolutePath());
+ try {
+ vfs = new VirtualFileSystem(db.getAbsolutePath());
+ } catch (Exception e) {
+ Log.e(TAG, e.toString());
+ }
}
protected void tearDown() {
Please sign in to comment.
Something went wrong with that request. Please try again.