Example usage for android.os StatFs getAvailableBlocks

List of usage examples for android.os StatFs getAvailableBlocks

Introduction

In this page you can find the example usage for android.os StatFs getAvailableBlocks.

Prototype

@Deprecated
public int getAvailableBlocks() 

Source Link

Usage

From source file:com.codingPower.framework.worker.ImageCache.java

/**
 * Check how much usable space is available at a given path.
 *
 * @param path The path to check/*from www .  jav  a 2s  .  co m*/
 * @return The space available in bytes
 */
public static long getUsableSpace(File path) {
    final StatFs stats = new StatFs(path.getPath());
    return (long) stats.getBlockSize() * (long) stats.getAvailableBlocks();
}

From source file:de.s2hmobile.bitmaps.ImageCache.java

@SuppressWarnings("deprecation")
private static int getUsableSpaceFroyo(final File path) {
    final StatFs stats = new StatFs(path.getPath());
    return stats.getBlockSize() * stats.getAvailableBlocks();
}

From source file:com.airad.zhonghan.ui.components.ImageCache.java

/**
 * Check how much usable space is available at a given path.
 * //from   ww w  . j  av  a 2s  . c o m
 * @param path
 *            The path to check
 * @return The space available in bytes
 */
@TargetApi(9)
public static long getUsableSpace(File path) {
    final StatFs stats = new StatFs(path.getPath());
    return (long) stats.getBlockSize() * (long) stats.getAvailableBlocks();
}

From source file:net.iaf.framework.imgload.ImageCache.java

/**
 * Check how much usable space is available at a given path.
 *
 * @param path The path to check/* w w  w.  j  a va2 s  .c  o  m*/
 * @return The space available in bytes
 */
@TargetApi(9)
public static long getUsableSpace(File path) {
    if (SDKVersionUtil.hasGingerbread()) {
        return path.getUsableSpace();
    }
    final StatFs stats = new StatFs(path.getPath());
    return (long) stats.getBlockSize() * (long) stats.getAvailableBlocks();
}

From source file:com.shine.hotels.util.ImageCache.java

/**
 * Check how much usable space is available at a given path.
 *
 * @param path The path to check/*from   w ww  . j a v  a2  s  . com*/
 * @return The space available in bytes
 */
//@TargetApi(9)
public static long getUsableSpace(File path) {
    //        if (UIUtils.hasGingerbread()) {
    //            return path.getUsableSpace();
    //        }
    final StatFs stats = new StatFs(path.getPath());
    return (long) stats.getBlockSize() * (long) stats.getAvailableBlocks();
}

From source file:com.fivehundredpxdemo.android.storage.ImageCache.java

/**
 * Check how much usable space is available at a given path.
 *
 * @param path The path to check//from  w  w w  .j  a  v  a  2s  .com
 * @return The space available in bytes
 */
@TargetApi(9)
public static long getUsableSpace(File path) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
        return path.getUsableSpace();
    }
    final StatFs stats = new StatFs(path.getPath());
    return (long) stats.getBlockSize() * (long) stats.getAvailableBlocks();
}

From source file:com.example.image.ImageCache.java

/**
 * Check how much usable space is available at a given path.
 *
 * @param path The path to check//from   w w w .  j  a  va 2  s .co m
 * @return The space available in bytes
 */
@TargetApi(9)
public static long getUsableSpace(File path) {
    if (VersionUtils.hasGingerbread()) {
        return path.getUsableSpace();
    }
    final StatFs stats = new StatFs(path.getPath());
    return (long) stats.getBlockSize() * (long) stats.getAvailableBlocks();
}

From source file:com.haipeng.libraryforandroid.cacheormemory.imageload.ImageCache.java

/**
 * Check how much usable space is available at a given path.
 *
 * @param path The path to check/*from w  ww .  ja  va 2  s . c o  m*/
 * @return The space available in bytes
 */
@SuppressWarnings("deprecation")
@TargetApi(9)
public static long getUsableSpace(File path) {
    if (SDKVersionUtil.hasGingerbread()) {
        return path.getUsableSpace();
    }
    final StatFs stats = new StatFs(path.getPath());
    return (long) stats.getBlockSize() * (long) stats.getAvailableBlocks();
}

From source file:com.xiaodong.dream.catcher.demo.image.ImageCache.java

/**
 * Check how much usable space is available at a given path.
 *
 * @param path The path to check// w  w  w.  ja  va2s . co  m
 * @return The space available in bytes
 */
@TargetApi(9)
public static long getUsableSpace(File path) {
    if (ImageUtils.hasGingerbread()) {
        return path.getUsableSpace();
    }
    final StatFs stats = new StatFs(path.getPath());
    return (long) stats.getBlockSize() * (long) stats.getAvailableBlocks();

}

From source file:android.support.asy.image.ImageCache.java

/**
 * Check how much usable space is available at a given path.
 * /*from   w  w w .  j a v a  2s. c o m*/
 * @param path
 *            The path to check
 * @return The space available in bytes
 */
public static long getUsableSpace(File path) {
    // if (Utils.hasGingerbread()) {
    // return path.getUsableSpace();
    // }
    final StatFs stats = new StatFs(path.getPath());
    return (long) stats.getBlockSize() * (long) stats.getAvailableBlocks();
}