Zip Entry Is Directory Example In Java

Chapter: ZIP Last Updated: 23-04-2016 07:41:52 UTC

Program:

            /* ............... START ............... */
                

import java.io.IOException;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

public class JavaZipEntryIsDirectory {
	public static void main(String args[]) {
		try {

			ZipFile zipFile = new ZipFile("c:/File/Files.zip");

			Enumeration enumeration = zipFile.entries();

			System.out.print("File Name");
			System.out.print("\t\t\t\tIs Directory");
			System.out.print("\n---------------------------------\n");

			while (enumeration.hasMoreElements()) {

				ZipEntry entry = (ZipEntry) enumeration.nextElement();

				String entryName = entry.getName();
				boolean isDir = entry.isDirectory();

				System.out.print(entryName);
				System.out.print("\t\t\t\t" + isDir);
				System.out.print("\n");

			}

			zipFile.close();

		} catch (IOException ioe) {
			System.out.println("Error opening zip file" + ioe);
		}
	}
}
                /* ............... END ............... */
        

Tags

Zip Entry Is Directory Example , Java

Similar Programs Chapter Last Updated
Create Zip File With CRC32 Checksum In Java ZIP 23-04-2016
Create Zip File With Adler32 Checksum In Java ZIP 23-04-2016
Extract Zip File With Adler32 Checksum In Java ZIP 23-04-2016
Extract File With CRC32 Checksum In Java ZIP 23-04-2016
CRC32 Checksum In Java ZIP 10-08-2016
Adler32 Checksum In Java ZIP 23-04-2016
Read Zip File Checksum Value In Java Example ZIP 20-07-2016
Create Checksum For Zip File In Java ZIP 07-08-2017
Decompress Zip File Using ZipInputStream In Java ZIP 20-07-2016
Read Entries In Zip File In Java Example ZIP 20-07-2016
List The Contents Of Zip File In Java Example ZIP 07-08-2017
Extract Contents Of Zip File In Java Example ZIP 07-08-2017
Zip File Creation In Java Example ZIP 23-06-2016

1