@Override public synchronized void initialize(){
  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;
  }
  for (  File file : files) {
    FileInputStream fis=null;
    try {
      fis=new FileInputStream(file);
      CacheHeader entry=CacheHeader.readHeader(fis);
      entry.size=file.length();
      putEntry(entry.key,entry);
    }
 catch (    IOException e) {
      if (file != null) {
        file.delete();
      }
    }
 finally {
      try {
        if (fis != null) {
          fis.close();
        }
      }
 catch (      IOException ignored) {
      }
    }
  }
}

@ Override public synchronized void initialize ( ) { 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 ; } for ( File file : files ) { FileInputStream fis = null ; try { fis = new FileInputStream ( file ) ; CacheHeader entry = CacheHeader . readHeader ( fis ) ; entry . size = file . length ( ) ; putEntry ( entry . key , entry ) ; } catch ( IOException e ) { if ( file != null ) { file . delete ( ) ; } } finally { try { if ( fis != null ) { fis . close ( ) ; } } catch ( IOException ignored ) { } } } }
initializes the diskbasedcache by scanning for all files currently in the specified root directory . creates the root directory if necessary .
