public synchronized void initialize(){
  if (mInitialized) {
    return;
  }
  mInitialized=true;
  if (!mRootDirectory.exists()) {
    if (!mRootDirectory.mkdirs()) {
      VolleyLog.e("Unable to create cache dir %s",mRootDirectory.getAbsolutePath());
    }
    return;
  }
  File[] files=mRootDirectory.listFiles();
  if (files == null) {
    return;
  }
  VolleyLog.d("Loading %d files from cache",files.length);
  ExecutorService executor=new ThreadPoolExecutor(CACHE_LOAD_THREADS,CACHE_LOAD_THREADS,10,TimeUnit.MILLISECONDS,mQueue);
  for (  File file : files) {
    Callable<CacheHeader> callable=new HeaderParserCallable(file);
    RunnableFuture<CacheHeader> submit=new ReorderingFutureTask(callable);
    mLoadingFiles.put(file.getName(),submit);
    executor.execute(submit);
  }
}

public synchronized void initialize ( ) { if ( mInitialized ) { return ; } mInitialized = true ; if ( ! mRootDirectory . exists ( ) ) { if ( ! mRootDirectory . mkdirs ( ) ) { VolleyLog . e ( "Unable to create cache dir %s" , mRootDirectory . getAbsolutePath ( ) ) ; } return ; } File [ ] files = mRootDirectory . listFiles ( ) ; if ( files == null ) { return ; } VolleyLog . d ( "Loading %d files from cache" , files . length ) ; ExecutorService executor = new ThreadPoolExecutor ( CACHE_LOAD_THREADS , CACHE_LOAD_THREADS , 10 , TimeUnit . MILLISECONDS , mQueue ) ; for ( File file : files ) { Callable < CacheHeader > callable = new HeaderParserCallable ( file ) ; RunnableFuture < CacheHeader > submit = new ReorderingFutureTask ( callable ) ; mLoadingFiles . put ( file . getName ( ) , submit ) ; executor . execute ( submit ) ; } }
initializes the diskbasedcache by scanning for all files currently in the specified root directory . creates the root directory if necessary .
