congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
DiskCache.clear
Code IndexAdd Tabnine to your IDE (free)

How to use
clear
method
in
com.bumptech.glide.load.engine.cache.DiskCache

Best Java code snippets using com.bumptech.glide.load.engine.cache.DiskCache.clear (Showing top 10 results out of 315)

origin: bumptech/glide

@VisibleForTesting
synchronized void clearDiskCacheIfCreated() {
 if (diskCache == null) {
  return;
 }
 diskCache.clear();
}
origin: bumptech/glide

public void clearDiskCache() {
 diskCacheProvider.getDiskCache().clear();
}
origin: bumptech/glide

@After
public void tearDown() {
 try {
  cache.clear();
 } finally {
  deleteRecursive(dir);
 }
}
origin: bumptech/glide

@Test
public void clearDiskCache_afterOpeningDiskCache_andDeleteDirectoryOutsideGlide_doesNotThrow() {
 DiskCache cache = DiskLruCacheWrapper.create(cacheDir, 1024 * 1024);
 cache.get(mock(Key.class));
 deleteRecursively(cacheDir);
 cache.clear();
}
origin: bumptech/glide

@Test
public void get_afterDeleteDirectoryOutsideGlideAndClose_doesNotThrow() {
 DiskCache cache = DiskLruCacheWrapper.create(cacheDir, 1024 * 1024);
 cache.get(mock(Key.class));
 deleteRecursively(cacheDir);
 cache.clear();
 cache.get(mock(Key.class));
}
origin: bumptech/glide

 @Test
 public void get_afterDeleteDirectoryOutsideGlideAndClose_doesNotThrow() {
  assumeTrue("A file handle is likely open, so cannot delete dir", !Util.isWindows());
  DiskCache cache = DiskLruCacheWrapper.create(dir, 1024 * 1024);
  cache.get(mock(Key.class));
  deleteRecursive(dir);
  cache.clear();

  cache.get(mock(Key.class));
 }
}
origin: bumptech/glide

@Test
public void clearDiskCache_afterOpeningDiskCache_andDeleteDirectoryOutsideGlide_doesNotThrow() {
 assumeTrue("A file handle is likely open, so cannot delete dir", !Util.isWindows());
 DiskCache cache = DiskLruCacheWrapper.create(dir, 1024 * 1024);
 cache.get(mock(Key.class));
 deleteRecursive(dir);
 cache.clear();
}
origin: bumptech/glide

@Test
public void loadFromCache_afterDiskCacheDeletedAndCleared_doesNotFail() {
 final DiskCache cache = DiskLruCacheWrapper.create(cacheDir, 1024 * 1024);
 cache.get(mock(Key.class));
 deleteRecursively(cacheDir);
 cache.clear();
 Glide.init(
   context,
   new GlideBuilder()
     .setDiskCache(new Factory() {
      @Override
      public DiskCache build() {
       return cache;
      }
     }));
 Drawable drawable =
   concurrency.get(
     Glide.with(context)
       .load(ResourceIds.raw.canonical)
       .submit());
 assertThat(drawable).isNotNull();
}
origin: guolindev/giffun

public void clearDiskCache() {
  diskCacheProvider.getDiskCache().clear();
}
origin: mozilla-tw/Rocket

public void clearDiskCache() {
 diskCacheProvider.getDiskCache().clear();
}
com.bumptech.glide.load.engine.cacheDiskCacheclear

Javadoc

Clear the cache.

Popular methods of DiskCache

  • get
    Get the cache for the value at the given key. Note - This is potentially dangerous, someone may writ
  • put
    Write to a key in the cache. Writer is used so that the cache implementation can perform actions aft
  • delete
    Remove the key and value from the cache.

Popular in Java

  • Parsing JSON documents to java classes using gson
  • startActivity (Activity)
  • getContentResolver (Context)
  • compareTo (BigDecimal)
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JFileChooser (javax.swing)
  • JList (javax.swing)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now