thrau / jarchivelib

A simple archiving and compression library for Java
https://github.com/thrau/jarchivelib
Apache License 2.0
198 stars 36 forks source link

Producing archives with non-standard extensions #50

Closed benbc closed 7 years ago

benbc commented 7 years ago

Hello

Would you consider taking a PR that made it possible to specify an alternative file extension? I'd like to use jarchivelib to create "dump" files for Neo4j, but we don't want to advertise the file format in the extension.

Thanks -Ben

thrau commented 7 years ago

Sure. I would suggest modifying CommonsArchiver#createNewArchiveFile. The condition could check if there is any file extension instead of the specific one. The ArchiverCompressorDecorator has a different mechanism for generating file extensions. Maybe you can come up with a solution.

thrau commented 7 years ago

Although I believe the chance is very small, it may break peoples code. A cleaner solution would probably be to extend the API with a function with the signature File create(File target, File sources...) (and the adjacent one) However, this would also be significantly more effort, as it would involve restructuring parts of the Archiver implementations.

benbc commented 7 years ago

Thank you. I've decided in the end to code against Commons Compress directly as well don't need the generality and flexibility that jarchivelib provides.