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

io.polyapi.plugin.error.validation.InexistentFileException Maven / Gradle / Ivy

There is a newer version: 0.15.3
Show newest version
package io.polyapi.plugin.error.validation;

import java.io.File;
import java.util.Optional;

/**
 * {@link ValidationException} thrown when a file in a determined path doesn't exist.
 */
public class InexistentFileException extends ValidationException {

    private final File file;

    public InexistentFileException(String propertyName, File file) {
        super(propertyName, "File property '%s' with value '" + Optional.ofNullable(file).map(File::getAbsolutePath).orElse("null") + "' does not exist.");
        this.file = file;
    }

    public File getFile() {
        return file;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy