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.inter.trade.imageframe.ImageCache.java

/**
 * Check how much usable space is available at a given path.
 *
 * @param path The path to check/*from w ww .j  av  a2 s  .  c o  m*/
 * @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();
}

From source file:com.wetrain.client.customviews.imagecache.ImageCache.java

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

From source file:us.happ.bitmap.ImageCache.java

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

From source file:com.androidsx.imagesearch.util.ImageCache.java

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

From source file:com.zz.lib.bitmapfun.util.ImageCache.java

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

From source file:com.gelakinetic.mtgfam.helpers.lruCache.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(VERSION_CODES.GINGERBREAD)
private 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();
}

From source file:net.wespot.pim.utils.images.ImageCache.java

/**
 * Check how much usable space is available at a given path.
 *
 * @param path The path to check//  w ww  .ja va2 s  .  com
 * @return The space available in bytes
 */
@TargetApi(Build.VERSION_CODES.GINGERBREAD)
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();
}

From source file:com.rp.justcast.photos.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 a2s . c om*/
 * @return The space available in bytes
 */
@TargetApi(VERSION_CODES.GINGERBREAD)
public static long getUsableSpace(File path) {
    if (JustCastUtils.hasGingerbread()) {
        return path.getUsableSpace();
    }
    final StatFs stats = new StatFs(path.getPath());
    return (long) stats.getBlockSize() * (long) stats.getAvailableBlocks();
}

From source file:com.chatitzemoumin.londoncoffeeapp.util.ImageCache.java

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

From source file:wb.android.cache.ImageCache.java

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