![JAR search and dependency download from the Maven repository](/logo.png)
no.difi.certvalidator.ValidatorLoader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commons-certvalidator Show documentation
Show all versions of commons-certvalidator Show documentation
Rule engine for creation of certificate validator.
package no.difi.certvalidator;
import no.difi.certvalidator.lang.ValidatorParsingException;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.HashMap;
import java.util.Map;
public class ValidatorLoader {
private Map objectStorage = new HashMap<>();
public static ValidatorLoader newInstance() {
return new ValidatorLoader();
}
private ValidatorLoader() {
}
public ValidatorLoader put(String key, Object value) {
objectStorage.put(key, value);
return this;
}
public ValidatorLoader putAll(Map values) {
if (values != null)
objectStorage.putAll(values);
return this;
}
public ValidatorGroup build(Path path) throws IOException, ValidatorParsingException {
InputStream inputStream = Files.newInputStream(path);
ValidatorGroup validatorGroup = build(inputStream);
inputStream.close();
return validatorGroup;
}
public ValidatorGroup build(InputStream inputStream) throws ValidatorParsingException {
return ValidatorLoaderParser.parse(inputStream, new HashMap<>(objectStorage));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy