public class StorageHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
private static org.slf4j.Logger |
LOGGER |
| Constructor and Description |
|---|
StorageHelper() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends Serializable> |
readFromFile(String filename)
Reads and deserializes the object from the file with the given name.
|
static <T extends Serializable> |
readFromFileSavely(String filename)
Reads and deserializes the object from the file with the given name.
|
static <T extends Serializable> |
storeToFile(T object,
String filename)
Serializes and stores the given object in the file with the given
filename.
|
static <T extends Serializable> |
storeToFileSavely(T object,
String filename)
Serializes and stores the given object in the file with the given
filename.
|
public static <T extends Serializable> T readFromFile(String filename) throws IOException, ClassNotFoundException
IOException - if an IO error occursClassNotFoundException - if the class inside the file can't be foundpublic static <T extends Serializable> T readFromFileSavely(String filename)
public static <T extends Serializable> void storeToFile(T object, String filename) throws IOException
IOException - if an IO error occurspublic static <T extends Serializable> boolean storeToFileSavely(T object, String filename)
Copyright © 2016–2017 Pivotal Software, Inc.. All rights reserved.