Name

Manifest

Synopsis

This class represents the manifest entry of a JAR file. getMainAttributes( ) returns an Attributes object that represents the manifest attributes that apply to the entire JAR file. getAttributes( ) returns an Attributes object that represents the manifest attributes specified for a single file in the JAR file. getEntries( ) returns a java.util.Map that maps the names of entries in the JAR file to the Attributes objects associated with those entries. getEntries( ) returns the Map object used internally by the Manifest. You can edit the contents of the Manifest by adding, deleting, or editing entries in the Map. read( ) reads manifest entries from an input stream, merging them into the current set of entries. write( ) writes the Manifest out to the specified output stream.

java.util.jar.Manifest

Figure 16-113. java.util.jar.Manifest

public class Manifest implements Cloneable {
// Public Constructors
     public Manifest( );  
     public Manifest(Manifest man);  
     public Manifest(java.io.InputStream is) throws java.io.IOException;  
// Public Instance Methods
     public void clear( );  
     public java.util.jar.Attributes getAttributes(String name);  
     public java.util.Map<String,java.util.jar.Attributes> getEntries( );     default:HashMap
     public java.util.jar.Attributes getMainAttributes( );  
     public void read(java.io.InputStream is) throws java.io.IOException;  
     public void write(java.io.OutputStream out) throws java.io.IOException; ...

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.