public class DirectoryValidator
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
DirectoryValidator.DirectoryCheckResult
Is storing result of directory validation.
|
static class |
DirectoryValidator.DirectoryCheckResults
This class is holding results of directory validation.
|
Constructor and Description |
---|
DirectoryValidator()
Creates DirectoryValidator to ensure directories read from
user (if any - default otherwise) settings via keys:
DeploymentConfiguration.KEY_USER_CACHE_DIR
DeploymentConfiguration.KEY_USER_PERSISTENCE_CACHE_DIR
DeploymentConfiguration.KEY_SYSTEM_CACHE_DIR
DeploymentConfiguration.KEY_USER_LOG_DIR
DeploymentConfiguration.KEY_USER_TMP_DIR
DeploymentConfiguration.KEY_USER_LOCKS_DIR
|
DirectoryValidator(java.util.List<java.io.File> dirsToCheck)
Creates DirectoryValidator to ensure given directories
|
Modifier and Type | Method and Description |
---|---|
DirectoryValidator.DirectoryCheckResults |
ensureDirs()
This method is ensuring, that specified directories will exists after
call and will have enough permissions.
|
public DirectoryValidator(java.util.List<java.io.File> dirsToCheck)
dirsToCheck
- dirs to checkpublic DirectoryValidator()
public DirectoryValidator.DirectoryCheckResults ensureDirs()
This methods is trying to create the directories if they are not present and is testing if can be written inside. All checks are done in bulk. If one or more defect is found, user is warned via dialogue in gui mode (again in bulk). In headless mode stdout/stderr is enough, as application (both gui and headless) should not stop to work, but continue to run with hope that corrupted dirs will not be necessary