示例#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;
 }
示例#2
0
 public static final void flushDbCache() {
   if (mDb != null) mDb.clear();
 }
示例#3
0
 /** Explicitly close the cache Database adapter. */
 public static void closeDb() {
   try {
     if (mDb != null) mDb.close();
   } catch (Exception e) {
   }
 }
示例#4
0
 public int deleteFolderFromDb() {
   if (!AllowDBCache) return 0;
   if (mDb != null) return mDb.deleteFolder(this);
   else return -1;
 }