Create a program that opens a ZIP file, moves through its contents, and displays details about each file inside the archive. This includes the file name and its size in bytes.
ZipFile with java.util.zip
Listing contents and sizes of files in a ZIP archive
Report a typo
Reorder lines using drag or arrows. Adjust indentation with left buttons
}
fun main() {
ZipFile(zipFilePath).use { zip ->
}
import java.util.zip.ZipFile
val zipFilePath = "path/to/your/zipfile.zip"
}
println("${entry.name}: ${entry.size} bytes")
zip.entries().asSequence().forEach { entry ->
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.