@NonNull List<ResourceXmlDetector> xmlDetectors,
@NonNull List<File> files) {
for (File file : files) {
if (file.isDirectory()) {
// Is it a resource folder?
ResourceFolderType type = ResourceFolderType.getFolderType(file.getName());
if (type != null && new File(file.getParentFile(), RES_FOLDER).exists()) {
// Yes.
checkResourceFolder(project, main, file, type, xmlDetectors);
} else if (file.getName().equals(RES_FOLDER)) { // Is it the res folder?
// Yes
checkResFolder(project, main, file, xmlDetectors);
} else {
mClient.log(null, "Unexpected folder %1$s; should be project, " +
"\"res\" folder or resource folder", file.getPath());
continue;
}
} else if (file.isFile() && LintUtils.isXmlFile(file)) {
// Yes, find out its resource type
String folderName = file.getParentFile().getName();
ResourceFolderType type = ResourceFolderType.getFolderType(folderName);
if (type != null) {
XmlVisitor visitor = getVisitor(type, xmlDetectors);
if (visitor != null) {
XmlContext context = new XmlContext(this, project, main, file, type);
fireEvent(EventType.SCANNING_FILE, context);