public class CsvFileStorage<T> extends FileStorage<java.util.List<T>>
| Constructor and Description |
|---|
CsvFileStorage(java.nio.file.Path storagePath,
java.util.List<T> emptyEntity,
java.lang.Class<T> recordType) |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.List<T> |
read(java.nio.file.Path dirPath,
java.lang.String id)
Reads an artifact.
|
protected boolean |
remove(java.nio.file.Path dirPath,
java.lang.String id)
Removes an artifact.
|
protected void |
write(java.nio.file.Path dirPath,
java.lang.String id,
java.util.List<T> entity)
Writes the artifacts to the file system.
|
get, getTagForId, put, putToReserved, remove, reserveprotected void write(java.nio.file.Path dirPath,
java.lang.String id,
java.util.List<T> entity)
throws java.io.IOException
FileStoragewrite in class FileStorage<java.util.List<T>>dirPath - The directory in which the artifact should be stored.id - The ID of the artifact.entity - The artifact to be stored.java.io.IOException - If writing fails.protected java.util.List<T> read(java.nio.file.Path dirPath, java.lang.String id) throws java.io.IOException
FileStorageread in class FileStorage<java.util.List<T>>java.io.IOExceptionprotected boolean remove(java.nio.file.Path dirPath,
java.lang.String id)
throws java.io.IOException
FileStorageremove in class FileStorage<java.util.List<T>>true if the artifact existed and was removed successfully.java.io.IOException