{
CronExpressionValidator validator = new CronExpressionValidator();
if ( !validator.validate( cronExpression ) )
{
throw new RepositoryAdminException( "Invalid cron expression.", "cronExpression" );
}
}
else
{
throw new RepositoryAdminException( "Cron expression cannot be empty." );
}
String repoLocation = removeExpressions( managedRepository.getLocation() );
if ( !GenericValidator.matchRegexp( repoLocation,
ManagedRepositoryAdmin.REPOSITORY_LOCATION_VALID_EXPRESSION ) )
{
throw new RepositoryAdminException(
"Invalid repository location. Directory must only contain alphanumeric characters, equals(=), question-marks(?), "
+ "exclamation-points(!), ampersands(&), forward-slashes(/), back-slashes(\\), underscores(_), dots(.), colons(:), tildes(~), and dashes(-).",
"location" );
}
}