FileStorage
public final class FileStorage<T extends Object> implements Storage
The Java IO File version of the StorageT to a given file location.
Summary
Public constructors |
|---|
<T extends Object> FileStorage( |
Public methods |
|
|---|---|
@NonNull StorageConnection<@NonNull T> |
Creates a storage connection which allows reading and writing to the underlying storage. |
Public constructors
FileStorage
public <T extends Object> FileStorage(
@NonNull Serializer<@NonNull T> serializer,
@NonNull Function1<@NonNull File, @NonNull InterProcessCoordinator> coordinatorProducer,
@NonNull Function0<@NonNull File> produceFile
)
| Parameters | |
|---|---|
@NonNull Serializer<@NonNull T> serializer |
The serializer that can write |
@NonNull Function1<@NonNull File, @NonNull InterProcessCoordinator> coordinatorProducer |
The producer to provide |
@NonNull Function0<@NonNull File> produceFile |
The file producer that returns the file that will be read and written. |
Public methods
createConnection
public @NonNull StorageConnection<@NonNull T> createConnection()
Creates a storage connection which allows reading and writing to the underlying storage.
Should be closed after usage.
| Throws | |
|---|---|
IOException |
Unrecoverable IO exception when trying to access the underlying storage. |