Tabnine Logo
Util
Code IndexAdd Tabnine to your IDE (free)

How to use
Util
in
com.nostra13.universalimageloader.cache.disc.impl.ext

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

origin: nostra13/Android-Universal-Image-Loader

  public void close() {
    for (InputStream in : ins) {
      Util.closeQuietly(in);
    }
  }
}
origin: nostra13/Android-Universal-Image-Loader

/**
 * Closes the cache and deletes all of its stored values. This will delete
 * all files in the cache directory including files that weren't created by
 * the cache.
 */
public void delete() throws IOException {
  close();
  Util.deleteContents(directory);
}
origin: nostra13/Android-Universal-Image-Loader

private static String inputStreamToString(InputStream in) throws IOException {
  return Util.readFully(new InputStreamReader(in, Util.UTF_8));
}
origin: nostra13/Android-Universal-Image-Loader

/** Sets the value at {@code index} to {@code value}. */
public void set(int index, String value) throws IOException {
  Writer writer = null;
  try {
    writer = new OutputStreamWriter(newOutputStream(index), Util.UTF_8);
    writer.write(value);
  } finally {
    Util.closeQuietly(writer);
  }
}
origin: nostra13/Android-Universal-Image-Loader

/**
 * Deletes the contents of {@code dir}. Throws an IOException if any file
 * could not be deleted, or if {@code dir} is not a readable directory.
 */
static void deleteContents(File dir) throws IOException {
  File[] files = dir.listFiles();
  if (files == null) {
    throw new IOException("not a readable directory: " + dir);
  }
  for (File file : files) {
    if (file.isDirectory()) {
      deleteContents(file);
    }
    if (!file.delete()) {
      throw new IOException("failed to delete file: " + file);
    }
  }
}
origin: com.nostra13.universalimageloader/universal-image-loader

private static String inputStreamToString(InputStream in) throws IOException {
  return Util.readFully(new InputStreamReader(in, Util.UTF_8));
}
origin: nostra13/Android-Universal-Image-Loader

private void readJournal() throws IOException {
  StrictLineReader reader = new StrictLineReader(new FileInputStream(journalFile), Util.US_ASCII);
  try {
    String magic = reader.readLine();
    String version = reader.readLine();
    String appVersionString = reader.readLine();
    String valueCountString = reader.readLine();
    String blank = reader.readLine();
    if (!MAGIC.equals(magic)
        || !VERSION_1.equals(version)
        || !Integer.toString(appVersion).equals(appVersionString)
        || !Integer.toString(valueCount).equals(valueCountString)
        || !"".equals(blank)) {
      throw new IOException("unexpected journal header: [" + magic + ", " + version + ", "
          + valueCountString + ", " + blank + "]");
    }
    int lineCount = 0;
    while (true) {
      try {
        readJournalLine(reader.readLine());
        lineCount++;
      } catch (EOFException endOfJournal) {
        break;
      }
    }
    redundantOpCount = lineCount - lruEntries.size();
  } finally {
    Util.closeQuietly(reader);
  }
}
origin: com.nostra13.universalimageloader/universal-image-loader

/**
 * Closes the cache and deletes all of its stored values. This will delete
 * all files in the cache directory including files that weren't created by
 * the cache.
 */
public void delete() throws IOException {
  close();
  Util.deleteContents(directory);
}
origin: wanliyang1990/WliveTV

private static String inputStreamToString(InputStream in) throws IOException {
  return Util.readFully(new InputStreamReader(in, Util.UTF_8));
}
origin: nostra13/Android-Universal-Image-Loader

  Util.closeQuietly(ins[i]);
} else {
  break;
origin: wanliyang1990/WliveTV

/**
 * Deletes the contents of {@code dir}. Throws an IOException if any file
 * could not be deleted, or if {@code dir} is not a readable directory.
 */
static void deleteContents(File dir) throws IOException {
  File[] files = dir.listFiles();
  if (files == null) {
    throw new IOException("not a readable directory: " + dir);
  }
  for (File file : files) {
    if (file.isDirectory()) {
      deleteContents(file);
    }
    if (!file.delete()) {
      throw new IOException("failed to delete file: " + file);
    }
  }
}
origin: jiangqqlmj/Android-Universal-Image-Loader-Modify

private static String inputStreamToString(InputStream in) throws IOException {
  return Util.readFully(new InputStreamReader(in, Util.UTF_8));
}
origin: com.nostra13.universalimageloader/universal-image-loader

  public void close() {
    for (InputStream in : ins) {
      Util.closeQuietly(in);
    }
  }
}
origin: wanliyang1990/WliveTV

/**
 * Closes the cache and deletes all of its stored values. This will delete
 * all files in the cache directory including files that weren't created by
 * the cache.
 */
public void delete() throws IOException {
  close();
  Util.deleteContents(directory);
}
origin: wanliyang1990/WliveTV

  public void close() {
    for (InputStream in : ins) {
      Util.closeQuietly(in);
    }
  }
}
origin: jiangqqlmj/Android-Universal-Image-Loader-Modify

/**
 * Closes the cache and deletes all of its stored values. This will delete
 * all files in the cache directory including files that weren't created by
 * the cache.
 */
public void delete() throws IOException {
  close();
  Util.deleteContents(directory);
}
origin: jiangqqlmj/Android-Universal-Image-Loader-Modify

  public void close() {
    for (InputStream in : ins) {
      Util.closeQuietly(in);
    }
  }
}
origin: com.nostra13.universalimageloader/universal-image-loader

/**
 * Deletes the contents of {@code dir}. Throws an IOException if any file
 * could not be deleted, or if {@code dir} is not a readable directory.
 */
static void deleteContents(File dir) throws IOException {
  File[] files = dir.listFiles();
  if (files == null) {
    throw new IOException("not a readable directory: " + dir);
  }
  for (File file : files) {
    if (file.isDirectory()) {
      deleteContents(file);
    }
    if (!file.delete()) {
      throw new IOException("failed to delete file: " + file);
    }
  }
}
origin: jiangqqlmj/Android-Universal-Image-Loader-Modify

/** Sets the value at {@code index} to {@code value}. */
public void set(int index, String value) throws IOException {
  Writer writer = null;
  try {
    writer = new OutputStreamWriter(newOutputStream(index), Util.UTF_8);
    writer.write(value);
  } finally {
    Util.closeQuietly(writer);
  }
}
origin: jiangqqlmj/Android-Universal-Image-Loader-Modify

/**
 * Deletes the contents of {@code dir}. Throws an IOException if any file
 * could not be deleted, or if {@code dir} is not a readable directory.
 */
static void deleteContents(File dir) throws IOException {
  File[] files = dir.listFiles();
  if (files == null) {
    throw new IOException("not a readable directory: " + dir);
  }
  for (File file : files) {
    if (file.isDirectory()) {
      deleteContents(file);
    }
    if (!file.delete()) {
      throw new IOException("failed to delete file: " + file);
    }
  }
}
com.nostra13.universalimageloader.cache.disc.impl.extUtil

Javadoc

Junk drawer of utility methods.

Most used methods

  • closeQuietly
  • deleteContents
    Deletes the contents of dir. Throws an IOException if any file could not be deleted, or if dir is no
  • readFully

Popular in Java

  • Running tasks concurrently on multiple threads
  • getExternalFilesDir (Context)
  • setContentView (Activity)
  • getApplicationContext (Context)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Reference (javax.naming)
  • JButton (javax.swing)
  • Option (scala)
  • Best IntelliJ 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