All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.bdeploy.common.cfg.ExistingPathValidator Maven / Gradle / Ivy

Go to download

Public API including dependencies, ready to be used for integrations and plugins.

There is a newer version: 7.3.6
Show newest version
package io.bdeploy.common.cfg;

import java.nio.file.Path;
import java.nio.file.Paths;

import io.bdeploy.common.cfg.Configuration.ConfigValidator;
import io.bdeploy.common.cfg.Configuration.ValidationMessage;
import io.bdeploy.common.util.PathHelper;

/**
 * Checks if the given {@link Path} exists.
 */
@ValidationMessage("Path does not exist, but should exist: %s")
public class ExistingPathValidator implements ConfigValidator {

    protected Path p;

    @Override
    public boolean test(String value) {
        p = Paths.get(value);
        return PathHelper.exists(p);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy