Package PamUtils
Class DiskSpaceFormat
java.lang.Object
PamUtils.DiskSpaceFormat
Functions to get and display disk space in sensible units.
- Author:
- dg50
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
formatSpace
(Long space) Format space in bytes,kBytes, etc.static String
getFileRoot
(String path) Get the file system root.static Long
getFreeSpace
(String path) Get the amount of space at the specified path or null if the path is not set, etc.
-
Constructor Details
-
DiskSpaceFormat
public DiskSpaceFormat()
-
-
Method Details
-
getFreeSpace
Get the amount of space at the specified path or null if the path is not set, etc.- Parameters:
file
- path- Returns:
- free space in bytes
-
getFileRoot
Get the file system root.- Parameters:
file
- path- Returns:
- file system root, e.g. C:
-
formatSpace
Format space in bytes,kBytes, etc.- Parameters:
space
-- Returns:
- String or null if space was null
-