Android Open Source - DiskLruImageCache Disk Utils






From Project

Back to project page DiskLruImageCache.

License

The source code is released under:

This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a co...

If you think the Android project DiskLruImageCache listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package it.sephiroth.android.library.disklruimagecache;
/*from  w w  w.  j  a va 2 s  .  co  m*/
import android.content.Context;
import android.os.Build;
import android.os.Environment;

import java.io.File;

public class DiskUtils {
  public static final int IO_BUFFER_SIZE = 8 * 1024;

  public static boolean isExternalStorageRemovable() {
    if( Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD ) {
      return Environment.isExternalStorageRemovable();
    }
    return true;
  }

  public static boolean hasExternalCacheDir() {
    return Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO;
  }

  public static File getExternalCacheDir( Context context ) {
    if( hasExternalCacheDir() ) {
      final File file = context.getExternalCacheDir();
      if( null != file ) {
        return file;
      }
    }
    return context.getCacheDir();
  }
}




Java Source Code List

it.sephiroth.android.library.disklruimagecache.DigestUtils.java
it.sephiroth.android.library.disklruimagecache.DiskLruImageCache.java
it.sephiroth.android.library.disklruimagecache.DiskUtils.java