public class BssIOUtils
extends java.lang.Object
Constructor and Description |
---|
BssIOUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
deleteEmptyParentFolders(java.io.File leafFolder)
Delete empty parent folders.
|
static void |
deleteFile(java.lang.String key)
Delete file.
|
static long |
fetchSize(java.lang.String key)
get file size.
|
static java.io.File |
getFile(java.lang.String key) |
static void |
init(BinaryStorageConfiguration binaryStorageConfig)
Binary Storage persistence location initialization.
|
static byte[] |
readFileToByteArray(java.lang.String path)
Reads a file, filling and return a byte array.
|
static java.io.InputStream |
readFileToInputStream(java.lang.String path)
Reads a file, filling a byte array.
|
static void |
writeByteArrayToFile(java.lang.String path,
byte[] data)
Saves array of bytes into file.
|
static void |
writeInputStreamToFile(java.lang.String path,
java.io.InputStream stream)
Writes input stream to file.
|
public static void init(BinaryStorageConfiguration binaryStorageConfig)
binaryStorageConfig
- public static void writeInputStreamToFile(java.lang.String path, java.io.InputStream stream) throws BinaryStorageException
path
- stream
- BinaryStorageException
public static void writeByteArrayToFile(java.lang.String path, byte[] data) throws BinaryStorageException
path
- data
- BinaryStorageException
public static byte[] readFileToByteArray(java.lang.String path) throws BinaryStorageException
path
- BinaryStorageException
public static java.io.InputStream readFileToInputStream(java.lang.String path) throws BinaryStorageException
BinaryStorageException
public static void deleteFile(java.lang.String key)
key
- public static java.io.File getFile(java.lang.String key)
key
- public static long fetchSize(java.lang.String key) throws BinaryStorageException
key
- BinaryStorageException
- file does not existpublic static void deleteEmptyParentFolders(java.io.File leafFolder)
leafFolder
- the leaf folder