Package org.robolectric.shadows
Class ShadowStatFs
java.lang.Object
org.robolectric.shadows.ShadowStatFs
Robolectic doesn't provide actual filesystem stats; rather, it provides the ability to specify
stats values in advance.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void__constructor__(String path) protected intprotected longprotected longprotected intprotected longprotected intprotected longRobolectric always uses a block size of 4096.protected intprotected longprotected longprotected longstatic voidregisterStats(File path, int blockCount, int freeBlocks, int availableBlocks) Register stats for a path, which will be used when a matchingStatFsinstance is created.static voidregisterStats(String path, int blockCount, int freeBlocks, int availableBlocks) Register stats for a path, which will be used when a matchingStatFsinstance is created.static voidreset()protected voidstatic voidunregisterStats(File path) Unregister stats for a path.static voidunregisterStats(String path) Unregister stats for a path.
-
Field Details
-
BLOCK_SIZE
public static final int BLOCK_SIZE- See Also:
-
-
Constructor Details
-
ShadowStatFs
public ShadowStatFs()
-
-
Method Details
-
__constructor__
-
getBlockSize
@Implementation protected int getBlockSize() -
getBlockCount
@Implementation protected int getBlockCount() -
getFreeBlocks
@Implementation protected int getFreeBlocks() -
getFreeBlocksLong
@Implementation protected long getFreeBlocksLong() -
getFreeBytes
@Implementation protected long getFreeBytes() -
getAvailableBytes
@Implementation protected long getAvailableBytes() -
getTotalBytes
@Implementation protected long getTotalBytes() -
getAvailableBlocks
@Implementation protected int getAvailableBlocks() -
restat
-
getBlockSizeLong
@Implementation protected long getBlockSizeLong()Robolectric always uses a block size of 4096. -
getBlockCountLong
@Implementation protected long getBlockCountLong() -
getAvailableBlocksLong
@Implementation protected long getAvailableBlocksLong() -
registerStats
Register stats for a path, which will be used when a matchingStatFsinstance is created.- Parameters:
path- path to the fileblockCount- number of blocksfreeBlocks- number of free blocksavailableBlocks- number of available blocks
-
registerStats
Register stats for a path, which will be used when a matchingStatFsinstance is created. AStatFsinstance matches if it extends path. If several registered paths match, we pick the longest one.- Parameters:
path- path to the fileblockCount- number of blocksfreeBlocks- number of free blocksavailableBlocks- number of available blocks
-
unregisterStats
Unregister stats for a path. If the path is not registered, it will be a no-op.- Parameters:
path- path to the file
-
unregisterStats
Unregister stats for a path. If the path is not registered, it will be a no-op.- Parameters:
path- path to the file
-
reset
@Resetter public static void reset()
-