本文整理匯總了Java中org.apache.commons.io.FileUtils.EMPTY_FILE_ARRAY屬性的典型用法代碼示例。如果您正苦於以下問題:Java FileUtils.EMPTY_FILE_ARRAY屬性的具體用法?Java FileUtils.EMPTY_FILE_ARRAY怎麽用?Java FileUtils.EMPTY_FILE_ARRAY使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.apache.commons.io.FileUtils
的用法示例。
在下文中一共展示了FileUtils.EMPTY_FILE_ARRAY屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: listFiles
/**
* List the contents of a directory
*
* @param file The file to list the contents of
* @return the directory contents or a zero length array if
* the empty or the file is not a directory
*/
private File[] listFiles(File file) {
File[] children = null;
if (file.isDirectory()) {
children = (fileFilter == null) ? file.listFiles() : file.listFiles(fileFilter);
}
if (children == null) {
children = FileUtils.EMPTY_FILE_ARRAY;
}
if (comparator != null && children.length > 1) {
Arrays.sort(children, comparator);
}
return children;
}
示例2: listFiles
/**
* List the contents of a directory
*
* @param file The file to list the contents of
* @return the directory contents or a zero length array if
* the empty or the file is not a directory
*/
private File[] listFiles(File file) {
File[] children = null;
if (file.isDirectory()) {
children = fileFilter == null ? file.listFiles() : file.listFiles(fileFilter);
}
if (children == null) {
children = FileUtils.EMPTY_FILE_ARRAY;
}
if (comparator != null && children.length > 1) {
Arrays.sort(children, comparator);
}
return children;
}