本文整理匯總了Java中org.apache.commons.io.FilenameUtils.wildcardMatch方法的典型用法代碼示例。如果您正苦於以下問題:Java FilenameUtils.wildcardMatch方法的具體用法?Java FilenameUtils.wildcardMatch怎麽用?Java FilenameUtils.wildcardMatch使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.commons.io.FilenameUtils
的用法示例。
在下文中一共展示了FilenameUtils.wildcardMatch方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: accept
import org.apache.commons.io.FilenameUtils; //導入方法依賴的package包/類
/**
* 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;
}
示例2: accept
import org.apache.commons.io.FilenameUtils; //導入方法依賴的package包/類
/**
* 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;
}
示例3: accept
import org.apache.commons.io.FilenameUtils; //導入方法依賴的package包/類
/**
* 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;
}