}
// not the requested type
return false;
}
FileUtils fileUtils = FileUtils.newFileUtils();
File parent = fileUtils.getParentFile(path);
// ** full-pathname specified == parent dir of path in list
if (parent != null && parent.exists()
&& file.equals(parent.getAbsolutePath())) {
if (type == null) {
log("Found: " + parent, Project.MSG_VERBOSE);
return true;
} else if (type.isDir()) {
log("Found directory: " + parent, Project.MSG_VERBOSE);
return true;
}
// not the requested type
return false;
}
// ** simple name specified == path in list + name
if (path.exists() && path.isDirectory()) {
if (checkFile(new File(path, file),
file + " in " + path)) {
return true;
}
}
// ** simple name specified == parent dir + name
if (parent != null && parent.exists()) {
if (checkFile(new File(parent, file),
file + " in " + parent)) {
return true;
}
}
// ** simple name specified == parent of parent dir + name
if (parent != null) {
File grandParent = fileUtils.getParentFile(parent);
if (grandParent != null && grandParent.exists()) {
if (checkFile(new File(grandParent, file),
file + " in " + grandParent)) {
return true;
}