Example usage for org.apache.commons.cli2.validation FileValidator setHidden

List of usage examples for org.apache.commons.cli2.validation FileValidator setHidden

Introduction

In this page you can find the example usage for org.apache.commons.cli2.validation FileValidator setHidden.

Prototype

public void setHidden(boolean hidden) 

Source Link

Document

Specifies whether the argument values must represent hidden files/directories.

Usage

From source file:org.mzd.shap.spring.cli.CommandLineApplication.java

public static FileValidator getFileValidator(boolean isDirectory, boolean isFile, boolean isExisting,
        boolean isHidden, boolean isReadable, boolean isWritable) {
    if (isDirectory && isFile) {
        throw new RuntimeException("Objects cannot simultaneously be a directory and a file");
    }/*  ww  w.  ja  v a2  s. co m*/
    FileValidator fv = new FileValidator();
    fv.setDirectory(isDirectory);
    fv.setExisting(isExisting);
    fv.setFile(isFile);
    fv.setHidden(isHidden);
    fv.setReadable(isReadable);
    fv.setWritable(isWritable);
    return fv;
}