KickJava   Java API By Example, From Geeks To Geeks.

Java > Java SE, EE, ME > java > util > jar > Manifest

java.util.jar
Class Manifest

java.lang.Object
  extended by java.util.jar.Manifest
All Implemented Interfaces:
Cloneable
See Also:
Top Examples, Source Code, Attributes

public void clear()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[1121]First main attribute must be the Jar Manifest-Version
By Anonymous on 2004/11/17 10:10:36  Rate
It is very useful to review JAR File Specification first at 
  
  
 http://java.sun.com/j2se/1.4.2/docs/guide/jar/jar.html


[1122]_
By Anonymous on 2005/04/11 15:42:27  Rate
Actually according to  ( both the old and new )  spec  ( the link at above ) the first Main attribute must be the Manifest-Version and it is  
 mandatory. Otherwise you will get an empty file. No exception is  
 thrown 
 


public Object clone()
See Also:
Cloneable
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public boolean equals(Object o)
See Also:
Hashtable, Object.hashCode()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public Attributes getAttributes(String name)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public Map<String,Attributes> getEntries()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public Attributes getMainAttributes()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int hashCode()
See Also:
Hashtable, Object.equals(java.lang.Object)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public Manifest()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public Manifest(InputStream is)
         throws IOException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[788]A manifest for a JAR file can only be created from an input stream
By Marie Antoine on 2004/05/20 00:58:36  Rate
A manifest for a JAR file can only be created from an input stream. This example creates a manifest from a file and from a constructed string. The format of a manifest is described in:  
     http://java.sun.com/products/jdk/1.2/docs/guide/jar/manifest.html 
     try  {  
         // Create a manifest from a file 
         InputStream fis = new FileInputStream ( "manifestfile" ) ; 
         Manifest manifest = new Manifest ( fis ) ; 
      
      
         // Construct a string version of a manifest 
         StringBuffer sbuf = new StringBuffer (  ) ; 
         sbuf.append ( "Manifest-Version: 1.0\n" ) ; 
         sbuf.append ( "\n" ) ; 
         sbuf.append ( "Name: javax/swing/JScrollPane.class\n" ) ; 
         sbuf.append ( "Java-Bean: True\n" ) ; 
      
         // Convert the string to a input stream 
         InputStream is = new ByteArrayInputStream ( sbuf.toString (  ) .getBytes ( "UTF-8" )  ) ; 
      
         // Create the manifest 
         manifest = new Manifest ( is ) ; 
      }  catch  ( IOException e )   {  
      }  
 


public Manifest(Manifest man)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void read(InputStream is)
          throws IOException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void write(OutputStream out)
           throws IOException
See Also:
getMainAttributes()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  

Popular Tags