FileContentPattern (final @NotNull String name) { return with(new PatternCondition<>("inDirectory") { @Override public boolean accepts(@NotNull FileContent fileContent, ProcessingContext context) { return name.equals(fileContent.getFile().getParent().getName()); } }); }