public abstract class PersistenceUtils extends Object
PersistentState
objectsConstructor and Description |
---|
PersistenceUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
fixMapContextFilePaths(PersistentState state,
File rootFolder)
Adjust all file-system related values with
rootFolder
as root folder. |
static Set<File> |
getRelatedFiles(PersistentState state)
Returns a list of all file-system related
state 's
values |
static Set<File> |
relocateFiles(PersistentState state,
Map<File,File> transformMapping,
File rootFolder)
Adjust all Files in
state based on
transformMapping . |
public static void fixMapContextFilePaths(PersistentState state, File rootFolder) throws PersistenceException
rootFolder
as root folder.state
- rootFolder
- PersistenceException
public static Set<File> getRelatedFiles(PersistentState state) throws PersistenceException
state
's
valuesstate
- PersistenceException
public static Set<File> relocateFiles(PersistentState state, Map<File,File> transformMapping, File rootFolder) throws PersistenceException
Adjust all Files in state
based on
transformMapping
.
Also, optionally. make final file path relatives to
rootFolder
if it's provided. (only in file which
rootFolder
is ancestor of)
All filenames will use unix-like filesystem separator character
state
- to adjusttransformMapping
- mapping with source files as key and target as valuerootFolder
- base folder for relative paths (could be null
)state
files with no matching in
transformMapping
PersistenceException