Java Code Examples for org.apache.commons.io.FilenameUtils.wildcardMatch()

The following are Jave code examples for showing how to use wildcardMatch() of the org.apache.commons.io.FilenameUtils class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Moenagade   File: WildcardFilter.java   View Source Code Vote up 5 votes
/**
 * Checks to see if the filename matches one of the wildcards.
 *
 * @param dir  the file directory
 * @param name  the filename
 * @return true if the filename matches one of the wildcards
 */
@Override
public boolean accept(File dir, String name) {
    if (dir != null && new File(dir, name).isDirectory()) {
        return false;
    }

    for (String wildcard : wildcards) {
        if (FilenameUtils.wildcardMatch(name, wildcard)) {
            return true;
        }
    }
    
    return false;
}
 
Example 2
Project: Moenagade   File: WildcardFilter.java   View Source Code Vote up 5 votes
/**
 * Checks to see if the filename matches one of the wildcards.
 *
 * @param file the file to check
 * @return true if the filename matches one of the wildcards
 */
@Override
public boolean accept(File file) {
    if (file.isDirectory()) {
        return false;
    }

    for (String wildcard : wildcards) {
        if (FilenameUtils.wildcardMatch(file.getName(), wildcard)) {
            return true;
        }
    }
    
    return false;
}
 
Example 3
Project: Moenagade   File: WildcardFileFilter.java   View Source Code Vote up 5 votes
/**
 * Checks to see if the filename matches one of the wildcards.
 *
 * @param dir  the file directory
 * @param name  the filename
 * @return true if the filename matches one of the wildcards
 */
@Override
public boolean accept(File dir, String name) {
    for (String wildcard : wildcards) {
        if (FilenameUtils.wildcardMatch(name, wildcard, caseSensitivity)) {
            return true;
        }
    }
    return false;
}
 
Example 4
Project: Moenagade   File: WildcardFileFilter.java   View Source Code Vote up 5 votes
/**
 * Checks to see if the filename matches one of the wildcards.
 *
 * @param file  the file to check
 * @return true if the filename matches one of the wildcards
 */
@Override
public boolean accept(File file) {
    String name = file.getName();
    for (String wildcard : wildcards) {
        if (FilenameUtils.wildcardMatch(name, wildcard, caseSensitivity)) {
            return true;
        }
    }
    return false;
}
 
Example 5
Project: lams   File: WildcardFilter.java   View Source Code Vote up 5 votes
/**
 * Checks to see if the filename matches one of the wildcards.
 *
 * @param dir  the file directory
 * @param name  the filename
 * @return true if the filename matches one of the wildcards
 */
@Override
public boolean accept(File dir, String name) {
    if (dir != null && new File(dir, name).isDirectory()) {
        return false;
    }

    for (String wildcard : wildcards) {
        if (FilenameUtils.wildcardMatch(name, wildcard)) {
            return true;
        }
    }
    
    return false;
}
 
Example 6
Project: lams   File: WildcardFilter.java   View Source Code Vote up 5 votes
/**
 * Checks to see if the filename matches one of the wildcards.
 *
 * @param file the file to check
 * @return true if the filename matches one of the wildcards
 */
@Override
public boolean accept(File file) {
    if (file.isDirectory()) {
        return false;
    }

    for (String wildcard : wildcards) {
        if (FilenameUtils.wildcardMatch(file.getName(), wildcard)) {
            return true;
        }
    }
    
    return false;
}
 
Example 7
Project: lams   File: WildcardFileFilter.java   View Source Code Vote up 5 votes
/**
 * Checks to see if the filename matches one of the wildcards.
 *
 * @param dir  the file directory (ignored)
 * @param name  the filename
 * @return true if the filename matches one of the wildcards
 */
@Override
public boolean accept(File dir, String name) {
    for (String wildcard : wildcards) {
        if (FilenameUtils.wildcardMatch(name, wildcard, caseSensitivity)) {
            return true;
        }
    }
    return false;
}
 
Example 8
Project: lams   File: WildcardFileFilter.java   View Source Code Vote up 5 votes
/**
 * Checks to see if the filename matches one of the wildcards.
 *
 * @param file  the file to check
 * @return true if the filename matches one of the wildcards
 */
@Override
public boolean accept(File file) {
    String name = file.getName();
    for (String wildcard : wildcards) {
        if (FilenameUtils.wildcardMatch(name, wildcard, caseSensitivity)) {
            return true;
        }
    }
    return false;
}