Class HashFileSystemHelper
java.lang.Object
fr.gouv.vitam.common.storage.filesystem.v2.HashFileSystemHelper
Helper for the FileSystem offer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
createContainer
(String container) Create a directory recursively in the sub treevoid
createDirectories
(Path path) Create recursively the directoriesgetPathContainer
(String containerName) Get the path of a containergetPathObject
(String container, String objectId) Get the path of an object based on its container and the objectIdboolean
isContainer
(String subpath) splitObjectId
(String objectId) Split objectId without extension
-
Constructor Details
-
HashFileSystemHelper
Constructor- Parameters:
rootPath
- : the base path of the storage . Will be appended to all requests- Throws:
IllegalArgumentException
- : if rootPath is equals to / (to prevent error)
-
-
Method Details
-
getPathContainer
Get the path of a container- Parameters:
containerName
-- Returns:
- the Path Object representing the container directory
-
splitObjectId
Split objectId without extension- Parameters:
objectId
-- Returns:
- a list of tokens that will represent the directory structure
- Throws:
ContentAddressableStorageServerException
-
getPathObject
public Path getPathObject(String container, String objectId) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException Get the path of an object based on its container and the objectId- Parameters:
container
-objectId
-- Returns:
- Path of the object
- Throws:
ContentAddressableStorageNotFoundException
- : container not foundContentAddressableStorageServerException
- : The objectId contains Separator character
-
createContainer
Create a directory recursively in the sub tree- Parameters:
container
- : relative path that will be appended at the end of the rootPath- Throws:
ContentAddressableStorageServerException
- : on I/O Errors
-
isContainer
- Parameters:
subpath
- : relative path that will be appended at the end of the rootPath- Returns:
- true if the subpath is a directory
-
createDirectories
Create recursively the directories- Parameters:
path
-- Throws:
ContentAddressableStorageServerException
-