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

Make all the optional things available through a builder parameter. #31

Closed
shelajev opened this issue Jun 3, 2013 · 4 comments
Closed
Assignees

Comments

@shelajev
Copy link
Contributor

shelajev commented Jun 3, 2013

We have a number of optional features that are wanted to include/exclude:

I would even go further and implemented a destination archive (#17) through a parameters map.

Would be cool to simplify an api to somehting like:

ZipUtil.addEntry(File, ZipEntrySource, ZipUtilParams.preserveTimestamp().charset(charset).output(destFile)); 

Then by default all simple methods would be inplace and with no parametrization, however we won't need to pollute the API with all the variations of charsets, timestamps, existense/lack of destination). Methods would be simpler.

What do you think? Other features that we want to add later could be added there as well, so we won't need to change public api there.

@reinra
Copy link
Contributor

reinra commented Jun 4, 2013

A more generic solution:

ZipUtil.create(File).charset(Charset).preserveTimestamp(true).addEntry(ZipEntrySource).addEntries(ZipEntrySource...).addDirectory(File).addArchive(File).execute()

addDirectory() and addArchive() should optionally take additional charset to override the output one.

@shelajev
Copy link
Contributor Author

Transformations, addArchive() and addDirectory() are not there yet.

I added charset (#29, #30) , timestamps (part of #19), optional destination (alternatively, it'll be inplace).
Also, Zips is not final and mostly uses instance methods, so it will be more extensible than ZipUtil (#23).

@reinra
Copy link
Contributor

reinra commented Jul 18, 2013

Added many comments to the commits.

@ghost ghost assigned shelajev Jul 19, 2013
shelajev added a commit that referenced this issue Aug 12, 2013
1. Rename instantiation methods:
 process(file) -> get(file) 
 get()         -> create() 
 
Now to create Zips instance you either get it from a file or create it. 

2. Methods that return Charset aware ZipOutputStream and ZipFile throw
IllegalStateException instead of IllegalArgumentException
@shelajev
Copy link
Contributor Author

Closing this issue, as other comments that @reinra left are worth having their own issues.

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

No branches or pull requests

2 participants