In this tutorial you will see how to search entry in ZipFile.
In this tutorial you will see how to search entry in ZipFile.In this tutorial, We will discuss the use of getEntry() method. The getEntry()
methods are
available in ZipFile class, and it is used to read entries
of zip files.
In this Example, we will search given entry in a zip file. The getEntry
method search specific
entry in a zip file, and returns specified
entry or null if it not available in it.
About ZipFile API:
The java.util.zip.ZipFile class extends javalang.Object class. It provides the following methods:
Return Type | Method | Description |
ZipEntry | getEntry() | The getEntry() method returns given name entry if entry found otherwise null if entry not found. |
import java.io.*;
searchEntry + " is found.");
|
C:\>java SearchEntry Entry name bharat.txt is found. |