JarEntry objects represent files stored inside a JAR archive. JarEntry is a subclass of java.util.zip.ZipEntry, and JarEntry objects are almost exactly like ZipEntry objects.

public class JarEntry extends ZipEntry

JarEntry has three constructors:

public JarEntry(String filename)
public JarEntry(ZipEntry entry)
public JarEntry(JarEntry entry)

You might use the first one if you were creating a JAR file from scratch, though that's rare. The other two are mainly for Java's internal use to allow the internal state of one JarEntry object to be quickly copied to a new JarEntry object.

JarEntry does not override any methods from ZipEntry. It inherits all of ZipEntry's assorted getter and setter and utility methods. It also provides two new methods:

public Attributes getAttributes( ) throws IOException
public Certificate[] getCertificates( )

The getAttributes( ) method returns the attributes for this entry as documented in the manifest file of the archive. In brief, an Attributes object is a map of the name/value pairs for the entry. This will be discussed further in the next section. The getCertificates( ) method returns an array of java.security.cert.Certificate objects formed from any signature files for this entry stored in the archive. These can be used to allow some classes more access to the system than they would normally get.

Basic I/O

Introducing I/O

Output Streams

Input Streams

Data Sources

File Streams

Network Streams

Filter Streams

Filter Streams

Print Streams

Data Streams

Streams in Memory

Compressing Streams

JAR Archives

Cryptographic Streams

Object Serialization

New I/O



Nonblocking I/O

The File System

Working with Files

File Dialogs and Choosers


Character Sets and Unicode

Readers and Writers

Formatted I/O with java.text


The Java Communications API


The J2ME Generic Connection Framework


Character Sets

Java I/O
Java I/O
ISBN: 0596527500
EAN: 2147483647
Year: 2004
Pages: 244

Flylib.com © 2008-2020.
If you may any questions please contact us: flylib@qtcs.net