Code example for Attributes

Methods: putValue

0
String version_header = Name.MANIFEST_VERSION.toString();
    try 
      { 
        String value = expectHeader(version_header, br);
        attr.putValue(MANIFEST_VERSION, value);
      } 
    catch (IOException ioe)
      { 
        throw new JarException("Manifest should start with a " + version_header
                               + ": " + ioe.getMessage());
      } 
  } 
 
  private static String expectHeader(String header, BufferedReader br)
      throws IOException 
  { 
    String s = br.readLine();
    if (s == null)
      throw new JarException("unexpected end of file");