A simple tool for working with zip archives from the command line developed just to become a little bit better acquainted with the Kotlin language.
- Packing files into one zip file
- Adding files to an existing zip archive
- If a directory is specified instead of an input file, the utility packages its contents recursively
- Unpacking an archive with the ability to specify (existing or not existing) a directory for it
- Archive comment support: reading comments from an archive, adding a comment to an archive, creating an archive with a comment
Make sure you have installed:
Then run the following command in the root directory of the project:
mvn compile
It creates kotlin-archiver.jar
there.
You can run the program in the following way:
java -jar kotlin-archiver.jar [arguments]
Use the following arguments to perform the appropriate action (square brackets mean optional):
# packing files into the zip archive with the ability to add a comment
-p -z target_file.zip -s source_file_or_dir_1 source_file_or_dir_2 ... [-c "comment"]
# add files into the existing zip archive
-a -z target_file.zip -s source_file_or_dir_1 source_file_or_dir_2 ...
# add an archive comment
-a -z target_file.zip -c "comment"
# extract the archive with the ability to specify destination directory
-e -z archive.zip [-o out_dir]
# get the archive comment
-g -z archive.zip
# help
-h
The following dependencies are used in the project:
- Kotlin 1.4.31
- Apache Ant 1.10.9
- Apache Commons CLI 1.4