Package net.sourceforge.jnlp.config
Class DirectoryValidator
- java.lang.Object
-
- net.sourceforge.jnlp.config.DirectoryValidator
-
public class DirectoryValidator extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DirectoryValidator.DirectoryCheckResult
Is storing result of directory validation.static class
DirectoryValidator.DirectoryCheckResults
This class is holding results of directory validation.
-
Constructor Summary
Constructors Constructor 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
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DirectoryValidator.DirectoryCheckResults
ensureDirs()
This method is ensuring, that specified directories will exists after call and will have enough permissions.
-
-
-
Constructor Detail
-
DirectoryValidator
public DirectoryValidator(java.util.List<java.io.File> dirsToCheck)
Creates DirectoryValidator to ensure given directories- Parameters:
dirsToCheck
- dirs to check
-
DirectoryValidator
public DirectoryValidator()
Creates DirectoryValidator to ensure directories read from user (if any - default otherwise) settings via keys:
-
-
Method Detail
-
ensureDirs
public DirectoryValidator.DirectoryCheckResults ensureDirs()
This method is ensuring, that specified directories will exists after call and will have enough permissions.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
- Returns:
- result of directory checks
-
-