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:android.bitmap.util.ImageCache.java

/**
 * Check how much usable space is available at a given path.
 *
 * @param path The path to check//from  ww w .ja va  2 s .  c  o  m
 * @return The space available in bytes
 */
@TargetApi(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.android.fragmentbase.cache.ImageCache.java

/**
 * Check how much usable space is available at a given path.
 *
 * @param path The path to check// w ww.j a v a  2  s.co  m
 * @return The space available in bytes
 */
@TargetApi(VERSION_CODES.GINGERBREAD)
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:com.common.library.bitmap.ImageCache.java

/**
 * Check how much usable space is available at a given path.
 *
 * @param path The path to check//from w  w w . j  av a 2  s  .  c o  m
 * @return The space available in bytes
 */
@TargetApi(VERSION_CODES.GINGERBREAD)
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.sughimura.samplebitmaps.util.ImageCache.java

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

From source file:com.ccz.viewimages.displayingbitmaps.util.ImageCache.java

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

From source file:com.slack.slackteam.cache.ImageCache.java

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

From source file:com.yooiistudios.newskit.core.cache.volley.ImageCache.java

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

From source file:com.nf2m.util.ImageCache.java

/**
 * Check how much usable space is available at UriObserver given path.
 *
 * @param path The path to check/* w w w .j  a  v  a 2s .  c om*/
 * @return The space available in bytes
 */
@TargetApi(VERSION_CODES.GINGERBREAD)
static long getUsableSpace(@NonNull 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:cn.com.wo.bitmap.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.c  o  m
 * @return The space available in bytes
 */
@TargetApi(9)
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.androidpi.bricks.gallery.lru.cache.ImageCache.java

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