@Override public synchronized void initialize(){
  if (!mRootDirectory.exists()) {
    if (!mRootDirectory.mkdirs()) {
      Loger.debug(String.format("Unable to create cache dir %s",mRootDirectory.getAbsolutePath()));
    }
    return;
  }
  File[] files=mRootDirectory.listFiles();
  if (files == null) {
    return;
  }
  for (  File file : files) {
    BufferedInputStream fis=null;
    try {
      fis=new BufferedInputStream(new FileInputStream(file));
      CacheHeader entry=CacheHeader.readHeader(fis);
      entry.size=file.length();
      putEntry(entry.key,entry);
    }
 catch (    IOException e) {
      file.delete();
    }
 finally {
      FileUtils.closeIO(fis);
    }
  }
}

@ Override public synchronized void initialize ( ) { if ( ! mRootDirectory . exists ( ) ) { if ( ! mRootDirectory . mkdirs ( ) ) { Loger . debug ( String . format ( "Unable to create cache dir %s" , mRootDirectory . getAbsolutePath ( ) ) ) ; } return ; } File [ ] files = mRootDirectory . listFiles ( ) ; if ( files == null ) { return ; } for ( File file : files ) { BufferedInputStream fis = null ; try { fis = new BufferedInputStream ( new FileInputStream ( file ) ) ; CacheHeader entry = CacheHeader . readHeader ( fis ) ; entry . size = file . length ( ) ; putEntry ( entry . key , entry ) ; } catch ( IOException e ) { file . delete ( ) ; } finally { FileUtils . closeIO ( fis ) ; } } }
initializes the diskbasedcache by scanning for all files currently in the specified root directory . creates the root directory if necessary .
