@Test public void mkdirShoudNotBeCalledWhenDirectoryExists() { File cacheDir = mock(File.class); given(cacheDir.exists()).willReturn(true); UniversalBaseDiscCache discCache = new UniversalBaseDiscCache(cacheDir, delegate){}; discCache.initialize(); verify(cacheDir, never()).mkdir(); }
@Override public synchronized void initialize() { if (cacheDir.exists()) { return; } if (!cacheDir.mkdir()) { VolleyLog.e("Unable to create cache dir %s", cacheDir.getAbsolutePath()); } }
UniversalBaseDiscCache extends UniversalDiscCache { @Override public synchronized void initialize() { if (cacheDir.exists()) { return; } if (!cacheDir.mkdir()) { VolleyLog.e("Unable to create cache dir %s", cacheDir.getAbsolutePath()); } } }
UniversalBaseDiscCache extends UniversalDiscCache { @Override public synchronized void initialize() { if (cacheDir.exists()) { return; } if (!cacheDir.mkdir()) { VolleyLog.e("Unable to create cache dir %s", cacheDir.getAbsolutePath()); } } protected  UniversalBaseDiscCache(File cacheDir, DiscCacheAware delegate); }
UniversalBaseDiscCache extends UniversalDiscCache { @Override public synchronized void initialize() { if (cacheDir.exists()) { return; } if (!cacheDir.mkdir()) { VolleyLog.e("Unable to create cache dir %s", cacheDir.getAbsolutePath()); } } protected  UniversalBaseDiscCache(File cacheDir, DiscCacheAware delegate); @Override synchronized void initialize(); }
UniversalBaseDiscCache extends UniversalDiscCache { @Override public synchronized void initialize() { if (cacheDir.exists()) { return; } if (!cacheDir.mkdir()) { VolleyLog.e("Unable to create cache dir %s", cacheDir.getAbsolutePath()); } } protected  UniversalBaseDiscCache(File cacheDir, DiscCacheAware delegate); @Override synchronized void initialize();  }