Java JarFile.getJarEntry(String name)

Syntax

JarFile.getJarEntry(String name) has the following syntax.

public JarEntry getJarEntry(String name)

Example

In the following code shows how to use JarFile.getJarEntry(String name) method.


//ww w  .jav  a 2 s  .c  o m
import java.io.File;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;

public class Main {
  public static void main(String[] argv) throws Exception {
    JarFile jarfile = new JarFile(new File("filename.jar"), true,JarFile.OPEN_READ);

    JarEntry entry = jarfile.getJarEntry("fileName");

  }
}




















Home »
  Java Tutorial »
    java.util.jar »




JarFile
Pack200