Skip to content

add exclusion path in the filter #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 26, 2017
Merged

add exclusion path in the filter #36

merged 5 commits into from
Dec 26, 2017

Conversation

thibaultfalque
Copy link
Collaborator

Add exclusion path in the filter of Files.walk: #35

@Nighthawk22
Copy link

Please merge!

@thibaultfalque
Copy link
Collaborator Author

No, not work for the moment.

@Nighthawk22
Copy link

Can I help with this PR? I think you are just not matching the ANT matchers, right?

@thibaultfalque
Copy link
Collaborator Author

I need to restart this PR because there are a NullPointerException. I'm gonna try to do it today. But If you want participate not problem.

}
}
return true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should be able to simply write something like return !listExcludedPath.contains(p.toFile().getPath()) instead of the loop.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To also improve the search, you should use a SortedSet instead of a List.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this PR is revived, I wonder if the test should not be changed to p.toFile().getPath().startsWith(s) instead of the strict equality.

In that case, you may want to use streams to reduce the amount of code.

thibaultfalque pushed a commit that referenced this pull request Nov 24, 2017
@danielleberre
Copy link
Contributor

@thibaultfalque should this PR be merged?

@thibaultfalque
Copy link
Collaborator Author

Yes it's possible if you are ok with the last correction.

@danielleberre danielleberre merged commit b677e19 into maintenance Dec 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants