File[] (final File dir) { if (dir == null) { return new File[0]; } File[] ret = dir.listFiles(FileFilters.filesWithExtension("xml")); if (ret == null) { LOG.error("cannot read directory: " + dir.getAbsolutePath()); return new File[0]; } return ret; }