Class AbstractFileStorage<K,V>
- java.lang.Object
-
- science.aist.jack.persistence.filesystem.AbstractFileStorage<K,V>
-
- Type Parameters:
K
- DataType of key which is used to save valueV
- DataType of objects which should be stored
- All Implemented Interfaces:
Storage<K,V>
- Direct Known Subclasses:
GenericFileStorage
public abstract class AbstractFileStorage<K,V> extends Object implements Storage<K,V>
Abstract Implementation of Storage Interface for storing objects in the TEMP folder of the file system
- Since:
- 2.0
- Author:
- Christoph Praschl
-
-
Field Summary
Fields Modifier and Type Field Description protected String
completePath
protected String
fileExtension
protected String
pathToTempFolder
-
Constructor Summary
Constructors Constructor Description AbstractFileStorage(String pathToSubFolder, String fileExtension)
AbstractFileStorage(String pathToSubFolder, String fileExtension, String subFolder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
buildPath(String filename)
Method for building path with given filenameprotected String
buildPath(String filename, String extension)
Method for building path with given filenameprotected String
generateStringToken()
Method for generating a random string keyString
getFileExtension()
Method for getting used file extension of storageString
getPath()
Method for getting the storage path
-
-
-
Method Detail
-
getPath
public String getPath()
Method for getting the storage path- Returns:
- Storage path
-
getFileExtension
public String getFileExtension()
Method for getting used file extension of storage- Returns:
- File extension
-
buildPath
protected String buildPath(String filename, String extension)
Method for building path with given filename- Parameters:
filename
- name of file at internal path (without file extension!)extension
- file extension- Returns:
- Complete path containing the name of the .txt file
-
buildPath
protected String buildPath(String filename)
Method for building path with given filename- Parameters:
filename
- name of file at internal path (without file extension!)- Returns:
- Complete path containing the name of the .txt file
-
generateStringToken
protected String generateStringToken()
Method for generating a random string key- Returns:
- Random string key with 32 letters
-
-