SMILA 1.0 API documentation

org.eclipse.smila.binarystorage.persistence.efs
Class EFSUtils

java.lang.Object
  extended by org.eclipse.smila.binarystorage.persistence.efs.EFSUtils

public class EFSUtils
extends java.lang.Object

EFS utility class.

Author:
mcimpean

Constructor Summary
EFSUtils()
           
 
Method Summary
static void deleteFile(java.lang.String path)
          Delete file.
static long fetchSize(java.lang.String path)
          get file size
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)
           
static void writeInputStreamToFile(java.lang.String path, java.io.InputStream stream)
          Writes input stream to file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EFSUtils

public EFSUtils()
Method Detail

init

public static void init(BinaryStorageConfiguration binaryStorageConfig)
Binary Storage persistence location initialization.

Parameters:
binaryStorageConfig -

writeInputStreamToFile

public static void writeInputStreamToFile(java.lang.String path,
                                          java.io.InputStream stream)
                                   throws BinaryStorageException
Writes input stream to file.

Parameters:
path -
stream -
Throws:
BinaryStorageException

writeByteArrayToFile

public static void writeByteArrayToFile(java.lang.String path,
                                        byte[] data)
                                 throws BinaryStorageException
Parameters:
key -
content -
Throws:
BinaryStorageException

readFileToByteArray

public static byte[] readFileToByteArray(java.lang.String path)
                                  throws BinaryStorageException
Reads a file, filling and return a byte array.

Parameters:
path -
Returns:
byte[]
Throws:
BinaryStorageException

readFileToInputStream

public static java.io.InputStream readFileToInputStream(java.lang.String path)
                                                 throws BinaryStorageException
Reads a file, filling a byte array. The caller is responsible for closing the returned input stream when is no longer needed.

Parameters:
path -
Returns:
InputStream
Throws:
BinaryStorageException

deleteFile

public static void deleteFile(java.lang.String path)
                       throws BinaryStorageException
Delete file.

Parameters:
key -
Throws:
BinaryStorageException

fetchSize

public static long fetchSize(java.lang.String path)
                      throws BinaryStorageException
get file size

Parameters:
path -
Throws:
BinaryStorageException - file does not exist

SMILA 1.0 API documentation