Class DirectoryChecker
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.plugins.core.impl.checker.DirectoryChecker
-
- All Implemented Interfaces:
ItemChecker
,Configurable
,LogEnabled
,Serviceable
public class DirectoryChecker extends AbstractLogEnabled implements Configurable, ItemChecker, Serviceable
Checks if the specified repository exists and optionally if the user has the writing rights
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
_checkWrite
Equals true if the directory has to be writableprivate boolean
_createsIfRequired
Creates the directory if it does not exist alreadyprivate ServiceManager
_sManager
private SourceResolver
_sourceResolver
The source resolver
-
Constructor Summary
Constructors Constructor Description DirectoryChecker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
_checkDirectory(String path)
Checks if the source exists and optionally checks if it is writablevoid
check(List<String> values)
Checks the validity of the parameters.void
configure(Configuration configuration)
void
service(ServiceManager sManager)
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_checkWrite
private boolean _checkWrite
Equals true if the directory has to be writable
-
_sourceResolver
private SourceResolver _sourceResolver
The source resolver
-
_createsIfRequired
private boolean _createsIfRequired
Creates the directory if it does not exist already
-
_sManager
private ServiceManager _sManager
-
-
Constructor Detail
-
DirectoryChecker
public DirectoryChecker()
-
-
Method Detail
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
service
public void service(ServiceManager sManager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
check
public void check(List<String> values) throws ItemCheckerTestFailureException
Description copied from interface:ItemChecker
Checks the validity of the parameters.- Specified by:
check
in interfaceItemChecker
- Parameters:
values
- the values to test- Throws:
ItemCheckerTestFailureException
- if the test failed
-
_checkDirectory
private void _checkDirectory(String path) throws ItemCheckerTestFailureException
Checks if the source exists and optionally checks if it is writable- Parameters:
path
- The path of the source to check- Throws:
ItemCheckerTestFailureException
- if an error occurred
-
-