@Implements(value=android.os.StatFs.class) public class ShadowStatFs extends java.lang.Object
Robolectic doesn’t provide actual filesystem stats; rather, it provides the ability to specify stats values in advance.
registerStats(File, int, int, int)
Modifier and Type | Field and Description |
---|---|
static int |
BLOCK_SIZE |
Constructor and Description |
---|
ShadowStatFs() |
Modifier and Type | Method and Description |
---|---|
void |
__constructor__(java.lang.String path) |
int |
getAvailableBlocks() |
long |
getAvailableBlocksLong() |
long |
getAvailableBytes() |
int |
getBlockCount() |
long |
getBlockCountLong() |
int |
getBlockSize() |
long |
getBlockSizeLong()
Robolectric always uses a block size of
4096 . |
int |
getFreeBlocks() |
long |
getFreeBlocksLong() |
long |
getFreeBytes() |
long |
getTotalBytes() |
static void |
registerStats(java.io.File path,
int blockCount,
int freeBlocks,
int availableBlocks)
Register stats for a path, which will be used when a matching
StatFs instance is created. |
static void |
registerStats(java.lang.String path,
int blockCount,
int freeBlocks,
int availableBlocks)
Register stats for a path, which will be used when a matching
StatFs instance is created. |
static void |
reset() |
void |
restat(java.lang.String path) |
public static final int BLOCK_SIZE
@Implementation public void __constructor__(java.lang.String path)
@Implementation public int getBlockSize()
@Implementation public int getBlockCount()
@Implementation public int getFreeBlocks()
@Implementation(minSdk=18) public long getFreeBlocksLong()
@Implementation(minSdk=18) public long getFreeBytes()
@Implementation(minSdk=18) public long getAvailableBytes()
@Implementation(minSdk=18) public long getTotalBytes()
@Implementation public int getAvailableBlocks()
@Implementation public void restat(java.lang.String path)
@Implementation(minSdk=18) public long getBlockSizeLong()
Robolectric always uses a block size of 4096
.
@Implementation(minSdk=18) public long getBlockCountLong()
@Implementation(minSdk=18) public long getAvailableBlocksLong()
public static void registerStats(java.io.File path, int blockCount, int freeBlocks, int availableBlocks)
Register stats for a path, which will be used when a matching StatFs
instance is created.
path
- path to the fileblockCount
- number of blocksfreeBlocks
- number of free blocksavailableBlocks
- number of available blockspublic static void registerStats(java.lang.String path, int blockCount, int freeBlocks, int availableBlocks)
Register stats for a path, which will be used when a matching StatFs
instance is created.
path
- path to the fileblockCount
- number of blocksfreeBlocks
- number of free blocksavailableBlocks
- number of available blocks@Resetter public static void reset()