Skip to content
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

Added option to exclude files #177

Merged
merged 1 commit into from
May 20, 2020
Merged

Added option to exclude files #177

merged 1 commit into from
May 20, 2020

Conversation

JarFiles
Copy link
Contributor

@JarFiles JarFiles commented May 4, 2020


public interface ExcludeFileHandler {

boolean isExcluded(File file);

Choose a reason for hiding this comment

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

What about more than one excluded file or directory?

- root
     -- firstFolder
     -- secondFolder
     -- thirdFolder
     -- firstFile
     -- secondFile

For example, I want to exclude firstFolder, secondFolder and firstFile.
I think I am not able to do it with current solution, right?

@JarFiles
Copy link
Contributor Author

JarFiles commented May 4, 2020

Yes that would be possible. Use ZipParameters#setExcludeFileHandler() and pass an instance of the ExcludeFileHandler. Now create a list of all files which you want to exclude and check if the file matches the file in the method parameter. I am on phone right now, I can post the code here tomorrow.

@fatmyxtap
Copy link

Oh, got it, thank you!

@JarFiles
Copy link
Contributor Author

JarFiles commented May 4, 2020

I hope everything works. Let me know if there is something wrong :)

@srikanth-lingala
Copy link
Owner

Sorry, I have been a bit busy lately. I will have a look at this tomorrow.

@fatmyxtap
Copy link

@srikanth-lingala hi, could you please check it?

@JarFiles
Copy link
Contributor Author

Any update?

@srikanth-lingala
Copy link
Owner

Sorry for the delay, but I am going through some of the busiest days now. I will have a look at it in a day or two.

@srikanth-lingala
Copy link
Owner

PR looks fine. I will merge it. I will add some test before making a release. I have created an issue for it #189

@srikanth-lingala srikanth-lingala merged commit 7bd3ff7 into srikanth-lingala:master May 20, 2020
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