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

io.swagger.codegen.ignore.rules.FileRule Maven / Gradle / Ivy

There is a newer version: 3.0.0-rc1
Show newest version
package io.swagger.codegen.ignore.rules;

import java.nio.file.FileSystems;
import java.nio.file.PathMatcher;
import java.util.List;

public class FileRule extends Rule {

    private PathMatcher matcher = null;

    FileRule(List syntax, String definition) {
        super(syntax, definition);
        matcher = FileSystems.getDefault().getPathMatcher("glob:"+this.getPattern());
    }

    @Override
    public Boolean matches(String relativePath) {
        return matcher.matches(FileSystems.getDefault().getPath(relativePath));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy