public void remove(String key) throws IllegalStateException {
  validateKey(key);
  Entry entry;
synchronized (mDiskCacheLock) {
    entry=mLruEntries.remove(key);
  }
  if (entry != null) {
    if (entry.getCurrentEditorStream() != null) {
      throw new IllegalStateException("trying to remove a disk cache entry that is still under edit.");
    }
    File file=entry.getCleanFile();
    if (!file.exists() || file.delete()) {
      mSizeInBytes.getAndAdd(-entry.getLengthInBytes());
    }
 else {
synchronized (mRemoveRetryLock) {
        mRemoveRetryList.add(entry);
      }
    }
  }
}

public void remove ( String key ) throws IllegalStateException { validateKey ( key ) ; Entry entry ; synchronized ( mDiskCacheLock ) { entry = mLruEntries . remove ( key ) ; } if ( entry != null ) { if ( entry . getCurrentEditorStream ( ) != null ) { throw new IllegalStateException ( "trying to remove a disk cache entry that is still under edit." ) ; } File file = entry . getCleanFile ( ) ; if ( ! file . exists ( ) || file . delete ( ) ) { mSizeInBytes . getAndAdd ( - entry . getLengthInBytes ( ) ) ; } else { synchronized ( mRemoveRetryLock ) { mRemoveRetryList . add ( entry ) ; } } } }
remove the entry with the given key from cache . if the entry is still under edit , editoroutputstream need to be committed / aborted before removing .
