public class ObjectStorageImpl extends Object implements ObjectStorage
| Constructor and Description |
|---|
ObjectStorageImpl(IOService ioService) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
delete(String path)
Delete a path from the object storage if exists.
|
boolean |
exists(String path)
Checks if a path exists into the object storage.
|
Path |
getPath(String first,
String... paths)
Return a path based on the filesystem that is implemented for storage
|
void |
init(URI rootURI)
Initialize the object storage.
|
<T> T |
read(String path)
Read the content of the path given
|
<T> void |
write(String path,
T value)
Write an object into the object storage.
|
<T> void |
write(String path,
T value,
boolean lock)
Write an object into the object storage.
|
@Inject
public ObjectStorageImpl(@Named(value="configIO")
IOService ioService)
public void init(URI rootURI)
ObjectStorageinit in interface ObjectStoragerootURI - The root URI where is going to create the file systempublic boolean exists(String path)
ObjectStorageexists in interface ObjectStoragepath - the path to the stored object.public <T> T read(String path)
ObjectStorageread in interface ObjectStoragepath - The path where the content is storedpublic <T> void write(String path, T value)
ObjectStoragewrite in interface ObjectStoragepath - The path where the object is going to be writtenvalue - The object itselfpublic <T> void write(String path, T value, boolean lock)
ObjectStoragewrite in interface ObjectStoragepath - The path where the object is going to be writtenvalue - The object itselflock - If the object storage should be locked while writingpublic void delete(String path)
ObjectStoragedelete in interface ObjectStoragepath - The path to deletepublic Path getPath(String first, String... paths)
ObjectStoragegetPath in interface ObjectStoragefirst - the path string or initial part of the path stringpaths - additional strings to be joined to form the path stringpublic void close()
close in interface ObjectStorageCopyright © 2012–2019 JBoss by Red Hat. All rights reserved.