Java ZipFile.getName()

Syntax

ZipFile.getName() has the following syntax.

public String getName()

Example

In the following code shows how to use ZipFile.getName() method.


import java.io.File;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
//from   ww w .j a v a2 s  .co m
public class Main {

  public static void main(String[] args) throws Exception {
    ZipFile zipFile = new ZipFile(new File("testfile.zip"),ZipFile.OPEN_READ);

    System.out.println(zipFile.getName());
  }
}




















Home »
  Java Tutorial »
    java.util.zip »




ZipEntry
ZipFile