Return ZIP file in a Micronaut Controller

In this tutorial, we will create a Micronaut REST API that generates and returns a ZIP file for download. Table of contents 1. Create a Micronaut Controller 2. Unit Testing the Controller 3. Run the Application 4. Download Source Code 5. References Technologies used: Java 21 Micronaut 4.7.6 Maven 3.9.6 1. Create a Micronaut Controller …

Read more

Working Gzip and tar.gz file in Kotlin

This article shows how we can compress, update, and decompress multiple files and folders into a tar.gz file using Kotlin. Table of contents: 1. Gzip vs. Java Zip 2. Add Apache Commons Compress Dependency 3. Compressing Files and Folders into a tar.gz 3.1 file name is too long (>100 bytes) 4. Decompressing a tar.gz File …

Read more

Zip4j – Java Library for ZIP Files (With Examples)

In this tutorial, we show how to use the Zip4j library for handling ZIP files like adding files and directories, updating existing ZIPs, password protection, and encryption. Table of Content: 1. Adding Zip4j Dependency 2. Creating a ZIP File and Adding Files 3. Adding a Directory to ZIP 4. Adding Files to an Existing ZIP …

Read more