io.bdeploy.common.cfg.MinionRootValidator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api Show documentation
Show all versions of api Show documentation
Public API including dependencies, ready to be used for integrations and plugins.
package io.bdeploy.common.cfg;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import io.bdeploy.common.cfg.Configuration.ConfigValidator;
import io.bdeploy.common.cfg.Configuration.ValidationMessage;
@ValidationMessage("Path is not an initialized BDeploy root directory, run 'bdeploy init': %s")
public class MinionRootValidator implements ConfigValidator {
@Override
public boolean validate(String value) {
Path target = Paths.get(value);
if (!Files.isDirectory(target)) {
return false;
}
return Files.isRegularFile(target.resolve("etc/state.json"));
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy