Permalink
Browse files

added static exists() to see if database exists

  • Loading branch information...
1 parent 995f2d8 commit aee2db601b47a70c7c27ecfe61c4bdbfbe1297b7 @commonsguy committed Sep 12, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/com/commonsware/cwac/prefs/SQLCipherStrategy.java
@@ -15,6 +15,7 @@
package com.commonsware.cwac.prefs;
import android.content.Context;
+import java.io.File;
import java.util.Collection;
import java.util.Map;
import com.commonsware.cwac.prefs.CWSharedPreferences.LoadPolicy;
@@ -25,6 +26,12 @@
CWSharedPreferences.StorageStrategy {
private SQLiteDatabase db=null;
+ public static boolean exists(Context ctxt, String key) {
+ File path=ctxt.getDatabasePath(key);
+
+ return(path.exists());
+ }
+
public SQLCipherStrategy(Context ctxt, String key, String password,
LoadPolicy loadPolicy) {
super(loadPolicy);

0 comments on commit aee2db6

Please sign in to comment.