String fileName = file.getName();
if (LintUtils.endsWith(fileName, DOT_XML)) {
String parentName = file.getParentFile().getName();
int dash = parentName.indexOf('-');
String typeName = parentName.substring(0, dash == -1 ? parentName.length() : dash);
ResourceType type = ResourceType.getEnum(typeName);
if (type != null && LintUtils.isFileBasedResourceType(type)) {
String baseName = fileName.substring(0, fileName.length() - DOT_XML.length());
String resource = R_PREFIX + typeName + '.' + baseName;
mDeclarations.add(resource);
mDeclarationToFile.put(resource, file);