Class FilesystemSupplementedRepositoryImpl.RelativePathTranslatorListener
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.repositories.filesystem.FilesystemSupplementedRepositoryImpl.RelativePathTranslatorListener
-
- Enclosing class:
- FilesystemSupplementedRepositoryImpl<Type extends VersionedFileFields<java.lang.Long> & IridaThing>
public static class FilesystemSupplementedRepositoryImpl.RelativePathTranslatorListener extends java.lang.Object
A JPA event listener to translate the relative paths stored in the database to absolute paths so that everyone after the repository knows where the file is actually stored.
-
-
Constructor Summary
Constructors Constructor Description RelativePathTranslatorListener()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
absolutePath(VersionedFileFields<java.lang.Long> fileSystemEntity)
Whenever aVersionedFileFields
is loaded from the database, we need to translate it's path from a relative path to an absolute path based on the storage directory for the type.static void
addBaseDirectory(java.lang.Class<?> c, java.nio.file.Path p)
Add a base directory to safe files tovoid
relativePath(VersionedFileFields<java.lang.Long> fileSystemEntity)
Before persisting aVersionedFileFields
to the database, we need to translate it to a relative path by stripping the storage directory for the type.
-
-
-
Method Detail
-
addBaseDirectory
public static void addBaseDirectory(java.lang.Class<?> c, java.nio.file.Path p)
Add a base directory to safe files to- Parameters:
c
- The class for the base directory to save filesp
- the path to save files to
-
absolutePath
public void absolutePath(VersionedFileFields<java.lang.Long> fileSystemEntity)
Whenever aVersionedFileFields
is loaded from the database, we need to translate it's path from a relative path to an absolute path based on the storage directory for the type.- Parameters:
fileSystemEntity
- the object to make absolute paths for
-
relativePath
public void relativePath(VersionedFileFields<java.lang.Long> fileSystemEntity)
Before persisting aVersionedFileFields
to the database, we need to translate it to a relative path by stripping the storage directory for the type.- Parameters:
fileSystemEntity
- the object to make relative paths for.
-
-