Exemplo n.º 1
0
 /**
  * Indicates whether file cache should be updated.
  *
  * @param delete {@code true} if update should be forced, {@code false} to cancel update if cache
  *     exists.
  * @return {@code true} if file should be cached, {@code false} if not.
  */
 public boolean addToDb(boolean delete) {
   if (mDb == null) return false;
   if (!AllowDBCache) return false;
   return mDb.createItem(this, delete) > 0;
 }
Exemplo n.º 2
0
 public static final void flushDbCache() {
   if (mDb != null) mDb.clear();
 }
Exemplo n.º 3
0
 /** Explicitly close the cache Database adapter. */
 public static void closeDb() {
   try {
     if (mDb != null) mDb.close();
   } catch (Exception e) {
   }
 }
Exemplo n.º 4
0
 public int deleteFolderFromDb() {
   if (!AllowDBCache) return 0;
   if (mDb != null) return mDb.deleteFolder(this);
   else return -1;
 }