Class HashFileSystemHelper
- java.lang.Object
-
- fr.gouv.vitam.common.storage.filesystem.v2.HashFileSystemHelper
-
public class HashFileSystemHelper extends java.lang.ObjectHelper for the FileSystem offer
-
-
Constructor Summary
Constructors Constructor Description HashFileSystemHelper(java.lang.String rootPath)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateContainer(java.lang.String container)Create a directory recursively in the sub treevoidcreateDirectories(java.nio.file.Path path)Create recursively the directoriesjava.nio.file.PathgetPathContainer(java.lang.String containerName)Get the path of a containerjava.nio.file.PathgetPathObject(java.lang.String container, java.lang.String objectId)Get the path of an object based on its container and the objectIdbooleanisContainer(java.lang.String subpath)java.util.List<java.lang.String>splitObjectId(java.lang.String objectId)Split objectId without extension
-
-
-
Method Detail
-
getPathContainer
public java.nio.file.Path getPathContainer(java.lang.String containerName)
Get the path of a container- Parameters:
containerName-- Returns:
- the Path Object representing the container directory
-
splitObjectId
public java.util.List<java.lang.String> splitObjectId(java.lang.String objectId) throws ContentAddressableStorageServerExceptionSplit objectId without extension- Parameters:
objectId-- Returns:
- a list of tokens that will represent the directory structure
- Throws:
ContentAddressableStorageServerException
-
getPathObject
public java.nio.file.Path getPathObject(java.lang.String container, java.lang.String objectId) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerExceptionGet 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
public void createContainer(java.lang.String container) throws ContentAddressableStorageServerExceptionCreate 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
public boolean isContainer(java.lang.String subpath)
- Parameters:
subpath- : relative path that will be appended at the end of the rootPath- Returns:
- true if the subpath is a directory
-
createDirectories
public void createDirectories(java.nio.file.Path path) throws ContentAddressableStorageServerExceptionCreate recursively the directories- Parameters:
path-- Throws:
ContentAddressableStorageServerException
-
-