congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
DiskLruCache$Entry.getCleanFile
Code IndexAdd Tabnine to your IDE (free)

How to use
getCleanFile
method
in
com.nostra13.universalimageloader.cache.disc.impl.ext.DiskLruCache$Entry

Best Java code snippets using com.nostra13.universalimageloader.cache.disc.impl.ext.DiskLruCache$Entry.getCleanFile (Showing top 20 results out of 315)

origin: nostra13/Android-Universal-Image-Loader

/**
 * Returns an unbuffered input stream to read the last committed value,
 * or null if no value has been committed.
 */
public InputStream newInputStream(int index) throws IOException {
  synchronized (DiskLruCache.this) {
    if (entry.currentEditor != this) {
      throw new IllegalStateException();
    }
    if (!entry.readable) {
      return null;
    }
    try {
      return new FileInputStream(entry.getCleanFile(index));
    } catch (FileNotFoundException e) {
      return null;
    }
  }
}
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

/**
 * Computes the initial size and collects garbage as a part of opening the
 * cache. Dirty entries are assumed to be inconsistent and will be deleted.
 */
private void processJournal() throws IOException {
  deleteIfExists(journalFileTmp);
  for (Iterator<Entry> i = lruEntries.values().iterator(); i.hasNext(); ) {
    Entry entry = i.next();
    if (entry.currentEditor == null) {
      for (int t = 0; t < valueCount; t++) {
        size += entry.lengths[t];
        fileCount++;
      }
    } else {
      entry.currentEditor = null;
      for (int t = 0; t < valueCount; t++) {
        deleteIfExists(entry.getCleanFile(t));
        deleteIfExists(entry.getDirtyFile(t));
      }
      i.remove();
    }
  }
}
origin: jiangqqlmj/Android-Universal-Image-Loader-Modify

if (success) {
  if (dirty.exists()) {
    File clean = entry.getCleanFile(i);
    dirty.renameTo(clean);
    long oldLength = entry.lengths[i];
origin: wanliyang1990/WliveTV

if (success) {
  if (dirty.exists()) {
    File clean = entry.getCleanFile(i);
    dirty.renameTo(clean);
    long oldLength = entry.lengths[i];
origin: com.nostra13.universalimageloader/universal-image-loader

if (success) {
  if (dirty.exists()) {
    File clean = entry.getCleanFile(i);
    dirty.renameTo(clean);
    long oldLength = entry.lengths[i];
origin: wanliyang1990/WliveTV

File file;
for (int i = 0; i < valueCount; i++) {
  file = entry.getCleanFile(i);
  files[i] = file;
  ins[i] = new FileInputStream(file);
origin: jiangqqlmj/Android-Universal-Image-Loader-Modify

File file;
for (int i = 0; i < valueCount; i++) {
  file = entry.getCleanFile(i);
  files[i] = file;
  ins[i] = new FileInputStream(file);
origin: com.nostra13.universalimageloader/universal-image-loader

File file;
for (int i = 0; i < valueCount; i++) {
  file = entry.getCleanFile(i);
  files[i] = file;
  ins[i] = new FileInputStream(file);
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: 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: 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

/**
 * Computes the initial size and collects garbage as a part of opening the
 * cache. Dirty entries are assumed to be inconsistent and will be deleted.
 */
private void processJournal() throws IOException {
  deleteIfExists(journalFileTmp);
  for (Iterator<Entry> i = lruEntries.values().iterator(); i.hasNext(); ) {
    Entry entry = i.next();
    if (entry.currentEditor == null) {
      for (int t = 0; t < valueCount; t++) {
        size += entry.lengths[t];
        fileCount++;
      }
    } else {
      entry.currentEditor = null;
      for (int t = 0; t < valueCount; t++) {
        deleteIfExists(entry.getCleanFile(t));
        deleteIfExists(entry.getDirtyFile(t));
      }
      i.remove();
    }
  }
}
origin: wanliyang1990/WliveTV

/**
 * Computes the initial size and collects garbage as a part of opening the
 * cache. Dirty entries are assumed to be inconsistent and will be deleted.
 */
private void processJournal() throws IOException {
  deleteIfExists(journalFileTmp);
  for (Iterator<Entry> i = lruEntries.values().iterator(); i.hasNext(); ) {
    Entry entry = i.next();
    if (entry.currentEditor == null) {
      for (int t = 0; t < valueCount; t++) {
        size += entry.lengths[t];
        fileCount++;
      }
    } else {
      entry.currentEditor = null;
      for (int t = 0; t < valueCount; t++) {
        deleteIfExists(entry.getCleanFile(t));
        deleteIfExists(entry.getDirtyFile(t));
      }
      i.remove();
    }
  }
}
origin: com.nostra13.universalimageloader/universal-image-loader

/**
 * Computes the initial size and collects garbage as a part of opening the
 * cache. Dirty entries are assumed to be inconsistent and will be deleted.
 */
private void processJournal() throws IOException {
  deleteIfExists(journalFileTmp);
  for (Iterator<Entry> i = lruEntries.values().iterator(); i.hasNext(); ) {
    Entry entry = i.next();
    if (entry.currentEditor == null) {
      for (int t = 0; t < valueCount; t++) {
        size += entry.lengths[t];
        fileCount++;
      }
    } else {
      entry.currentEditor = null;
      for (int t = 0; t < valueCount; t++) {
        deleteIfExists(entry.getCleanFile(t));
        deleteIfExists(entry.getDirtyFile(t));
      }
      i.remove();
    }
  }
}
origin: jiangqqlmj/Android-Universal-Image-Loader-Modify

/**
 * Returns an unbuffered input stream to read the last committed value,
 * or null if no value has been committed.
 */
public InputStream newInputStream(int index) throws IOException {
  synchronized (DiskLruCache.this) {
    if (entry.currentEditor != this) {
      throw new IllegalStateException();
    }
    if (!entry.readable) {
      return null;
    }
    try {
      return new FileInputStream(entry.getCleanFile(index));
    } catch (FileNotFoundException e) {
      return null;
    }
  }
}
origin: wanliyang1990/WliveTV

/**
 * Returns an unbuffered input stream to read the last committed value,
 * or null if no value has been committed.
 */
public InputStream newInputStream(int index) throws IOException {
  synchronized (DiskLruCache.this) {
    if (entry.currentEditor != this) {
      throw new IllegalStateException();
    }
    if (!entry.readable) {
      return null;
    }
    try {
      return new FileInputStream(entry.getCleanFile(index));
    } catch (FileNotFoundException e) {
      return null;
    }
  }
}
origin: com.nostra13.universalimageloader/universal-image-loader

/**
 * Returns an unbuffered input stream to read the last committed value,
 * or null if no value has been committed.
 */
public InputStream newInputStream(int index) throws IOException {
  synchronized (DiskLruCache.this) {
    if (entry.currentEditor != this) {
      throw new IllegalStateException();
    }
    if (!entry.readable) {
      return null;
    }
    try {
      return new FileInputStream(entry.getCleanFile(index));
    } catch (FileNotFoundException e) {
      return null;
    }
  }
}
origin: nostra13/Android-Universal-Image-Loader

File file;
for (int i = 0; i < valueCount; i++) {
  file = entry.getCleanFile(i);
  files[i] = file;
  ins[i] = new FileInputStream(file);
origin: nostra13/Android-Universal-Image-Loader

if (success) {
  if (dirty.exists()) {
    File clean = entry.getCleanFile(i);
    dirty.renameTo(clean);
    long oldLength = entry.lengths[i];
com.nostra13.universalimageloader.cache.disc.impl.extDiskLruCache$EntrygetCleanFile

Popular methods of DiskLruCache$Entry

  • <init>
  • getDirtyFile
  • getLengths
  • invalidLengths

Popular in Java

  • Making http requests using okhttp
  • setScale (BigDecimal)
  • setRequestProperty (URLConnection)
  • getContentResolver (Context)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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