Tabnine Logo
DiskLruCache.checkNotClosed
Code IndexAdd Tabnine to your IDE (free)

How to use
checkNotClosed
method
in
com.nostra13.universalimageloader.cache.disc.impl.ext.DiskLruCache

Best Java code snippets using com.nostra13.universalimageloader.cache.disc.impl.ext.DiskLruCache.checkNotClosed (Showing top 16 results out of 315)

origin: nostra13/Android-Universal-Image-Loader

/** Force buffered operations to the filesystem. */
public synchronized void flush() throws IOException {
  checkNotClosed();
  trimToSize();
  trimToFileCount();
  journalWriter.flush();
}
origin: nostra13/Android-Universal-Image-Loader

private synchronized Editor edit(String key, long expectedSequenceNumber) throws IOException {
  checkNotClosed();
  validateKey(key);
  Entry entry = lruEntries.get(key);
  if (expectedSequenceNumber != ANY_SEQUENCE_NUMBER && (entry == null
      || entry.sequenceNumber != expectedSequenceNumber)) {
    return null; // Snapshot is stale.
  }
  if (entry == null) {
    entry = new Entry(key);
    lruEntries.put(key, entry);
  } else if (entry.currentEditor != null) {
    return null; // Another edit is in progress.
  }
  Editor editor = new Editor(entry);
  entry.currentEditor = editor;
  // Flush the journal before creating files to prevent file leaks.
  journalWriter.write(DIRTY + ' ' + key + '\n');
  journalWriter.flush();
  return editor;
}
origin: nostra13/Android-Universal-Image-Loader

/**
 * Drops the entry for {@code key} if it exists and can be removed. Entries
 * actively being edited cannot be removed.
 *
 * @return true if an entry was removed.
 */
public synchronized boolean remove(String key) throws IOException {
  checkNotClosed();
  validateKey(key);
  Entry entry = lruEntries.get(key);
  if (entry == null || entry.currentEditor != null) {
    return false;
  }
  for (int i = 0; i < valueCount; i++) {
    File file = entry.getCleanFile(i);
    if (file.exists() && !file.delete()) {
      throw new IOException("failed to delete " + file);
    }
    size -= entry.lengths[i];
    fileCount--;
    entry.lengths[i] = 0;
  }
  redundantOpCount++;
  journalWriter.append(REMOVE + ' ' + key + '\n');
  lruEntries.remove(key);
  if (journalRebuildRequired()) {
    executorService.submit(cleanupCallable);
  }
  return true;
}
origin: nostra13/Android-Universal-Image-Loader

checkNotClosed();
validateKey(key);
Entry entry = lruEntries.get(key);
origin: wanliyang1990/WliveTV

/** Force buffered operations to the filesystem. */
public synchronized void flush() throws IOException {
  checkNotClosed();
  trimToSize();
  trimToFileCount();
  journalWriter.flush();
}
origin: com.nostra13.universalimageloader/universal-image-loader

/** Force buffered operations to the filesystem. */
public synchronized void flush() throws IOException {
  checkNotClosed();
  trimToSize();
  trimToFileCount();
  journalWriter.flush();
}
origin: jiangqqlmj/Android-Universal-Image-Loader-Modify

/** Force buffered operations to the filesystem. */
public synchronized void flush() throws IOException {
  checkNotClosed();
  trimToSize();
  trimToFileCount();
  journalWriter.flush();
}
origin: com.nostra13.universalimageloader/universal-image-loader

private synchronized Editor edit(String key, long expectedSequenceNumber) throws IOException {
  checkNotClosed();
  validateKey(key);
  Entry entry = lruEntries.get(key);
  if (expectedSequenceNumber != ANY_SEQUENCE_NUMBER && (entry == null
      || entry.sequenceNumber != expectedSequenceNumber)) {
    return null; // Snapshot is stale.
  }
  if (entry == null) {
    entry = new Entry(key);
    lruEntries.put(key, entry);
  } else if (entry.currentEditor != null) {
    return null; // Another edit is in progress.
  }
  Editor editor = new Editor(entry);
  entry.currentEditor = editor;
  // Flush the journal before creating files to prevent file leaks.
  journalWriter.write(DIRTY + ' ' + key + '\n');
  journalWriter.flush();
  return editor;
}
origin: wanliyang1990/WliveTV

private synchronized Editor edit(String key, long expectedSequenceNumber) throws IOException {
  checkNotClosed();
  validateKey(key);
  Entry entry = lruEntries.get(key);
  if (expectedSequenceNumber != ANY_SEQUENCE_NUMBER && (entry == null
      || entry.sequenceNumber != expectedSequenceNumber)) {
    return null; // Snapshot is stale.
  }
  if (entry == null) {
    entry = new Entry(key);
    lruEntries.put(key, entry);
  } else if (entry.currentEditor != null) {
    return null; // Another edit is in progress.
  }
  Editor editor = new Editor(entry);
  entry.currentEditor = editor;
  // Flush the journal before creating files to prevent file leaks.
  journalWriter.write(DIRTY + ' ' + key + '\n');
  journalWriter.flush();
  return editor;
}
origin: jiangqqlmj/Android-Universal-Image-Loader-Modify

private synchronized Editor edit(String key, long expectedSequenceNumber) throws IOException {
  checkNotClosed();
  validateKey(key);
  Entry entry = lruEntries.get(key);
  if (expectedSequenceNumber != ANY_SEQUENCE_NUMBER && (entry == null
      || entry.sequenceNumber != expectedSequenceNumber)) {
    return null; // Snapshot is stale.
  }
  if (entry == null) {
    entry = new Entry(key);
    lruEntries.put(key, entry);
  } else if (entry.currentEditor != null) {
    return null; // Another edit is in progress.
  }
  Editor editor = new Editor(entry);
  entry.currentEditor = editor;
  // Flush the journal before creating files to prevent file leaks.
  journalWriter.write(DIRTY + ' ' + key + '\n');
  journalWriter.flush();
  return editor;
}
origin: com.nostra13.universalimageloader/universal-image-loader

/**
 * Drops the entry for {@code key} if it exists and can be removed. Entries
 * actively being edited cannot be removed.
 *
 * @return true if an entry was removed.
 */
public synchronized boolean remove(String key) throws IOException {
  checkNotClosed();
  validateKey(key);
  Entry entry = lruEntries.get(key);
  if (entry == null || entry.currentEditor != null) {
    return false;
  }
  for (int i = 0; i < valueCount; i++) {
    File file = entry.getCleanFile(i);
    if (file.exists() && !file.delete()) {
      throw new IOException("failed to delete " + file);
    }
    size -= entry.lengths[i];
    fileCount--;
    entry.lengths[i] = 0;
  }
  redundantOpCount++;
  journalWriter.append(REMOVE + ' ' + key + '\n');
  lruEntries.remove(key);
  if (journalRebuildRequired()) {
    executorService.submit(cleanupCallable);
  }
  return true;
}
origin: jiangqqlmj/Android-Universal-Image-Loader-Modify

/**
 * Drops the entry for {@code key} if it exists and can be removed. Entries
 * actively being edited cannot be removed.
 *
 * @return true if an entry was removed.
 */
public synchronized boolean remove(String key) throws IOException {
  checkNotClosed();
  validateKey(key);
  Entry entry = lruEntries.get(key);
  if (entry == null || entry.currentEditor != null) {
    return false;
  }
  for (int i = 0; i < valueCount; i++) {
    File file = entry.getCleanFile(i);
    if (file.exists() && !file.delete()) {
      throw new IOException("failed to delete " + file);
    }
    size -= entry.lengths[i];
    fileCount--;
    entry.lengths[i] = 0;
  }
  redundantOpCount++;
  journalWriter.append(REMOVE + ' ' + key + '\n');
  lruEntries.remove(key);
  if (journalRebuildRequired()) {
    executorService.submit(cleanupCallable);
  }
  return true;
}
origin: wanliyang1990/WliveTV

/**
 * Drops the entry for {@code key} if it exists and can be removed. Entries
 * actively being edited cannot be removed.
 *
 * @return true if an entry was removed.
 */
public synchronized boolean remove(String key) throws IOException {
  checkNotClosed();
  validateKey(key);
  Entry entry = lruEntries.get(key);
  if (entry == null || entry.currentEditor != null) {
    return false;
  }
  for (int i = 0; i < valueCount; i++) {
    File file = entry.getCleanFile(i);
    if (file.exists() && !file.delete()) {
      throw new IOException("failed to delete " + file);
    }
    size -= entry.lengths[i];
    fileCount--;
    entry.lengths[i] = 0;
  }
  redundantOpCount++;
  journalWriter.append(REMOVE + ' ' + key + '\n');
  lruEntries.remove(key);
  if (journalRebuildRequired()) {
    executorService.submit(cleanupCallable);
  }
  return true;
}
origin: com.nostra13.universalimageloader/universal-image-loader

checkNotClosed();
validateKey(key);
Entry entry = lruEntries.get(key);
origin: jiangqqlmj/Android-Universal-Image-Loader-Modify

checkNotClosed();
validateKey(key);
Entry entry = lruEntries.get(key);
origin: wanliyang1990/WliveTV

checkNotClosed();
validateKey(key);
Entry entry = lruEntries.get(key);
com.nostra13.universalimageloader.cache.disc.impl.extDiskLruCachecheckNotClosed

Popular methods of DiskLruCache

  • <init>
  • close
    Closes this cache. Stored values will remain on the filesystem.
  • delete
    Closes the cache and deletes all of its stored values. This will delete all files in the cache direc
  • deleteIfExists
  • edit
  • get
    Returns a snapshot of the entry named key, or null if it doesn't exist is not currently readable. If
  • getDirectory
    Returns the directory where this cache stores its data.
  • getMaxFileCount
    Returns the maximum number of files that this cache should store
  • getMaxSize
    Returns the maximum number of bytes that this cache should use to store its data.
  • journalRebuildRequired
    We only rebuild the journal when it will halve the size of the journal and eliminate at least 2000 o
  • open
    Opens the cache in directory, creating a cache if none exists there.
  • processJournal
    Computes the initial size and collects garbage as a part of opening the cache. Dirty entries are ass
  • open,
  • processJournal,
  • readJournal,
  • readJournalLine,
  • rebuildJournal,
  • remove,
  • renameTo,
  • trimToFileCount,
  • trimToSize

Popular in Java

  • Creating JSON documents from java classes using gson
  • findViewById (Activity)
  • scheduleAtFixedRate (Timer)
  • getExternalFilesDir (Context)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now