public boolean isPathIgnored(String relativePath) { final IFile file = CommonServices.getFileSystem().getIFile(new File(relativePath)); if (file != null && file.exists() && isConfigFile(file)) { final IModule module = TypeSystem.getExecutionEnvironment().getModule(file); if (module != null) { for (IDirectory dir : module.getSourcePath()) { if ("config".equals(dir.getName()) && file.isDescendantOf(dir)) { return false; } } } //System.out.println("Ignoring: " + relativePath); return true; } // for (String pattern : IGNORE_DIRECTORY_PATTERNS) { // if (relativePath.contains(pattern)) { // return true; // } // } return HASH.matches(relativePath); }
public boolean isPathIgnored(String relativePath) { if (relativePath == null) { return true; } final IFile file = CommonServices.getFileSystem().getIFile(new File(relativePath)); // AHK - We use file.getParent().hasChild() instead of file.exists() since we don't want to hit the disk // for the file existence check if we don't have to, and hasChild() will usually work off the cached sub-files // of a given directory if (file != null && file.getParent() != null && file.getParent().hasChildFile(file.getName()) && isConfigFile(file)) { final IModule module = TypeSystem.getExecutionEnvironment().getModule(file); if (module != null) { for (IDirectory dir : module.getSourcePath()) { if ("config".equals(dir.getName()) && file.isDescendantOf(dir)) { return false; } } } //System.out.println("Ignoring: " + relativePath); return true; } // for (String pattern : IGNORE_DIRECTORY_PATTERNS) { // if (relativePath.contains(pattern)) { // return true; // } // } return HASH.matches(relativePath); }