Package java.util.jar

Examples of java.util.jar.Attributes.keySet()


    }

    public static Dictionary<String, String> getManifestHeaders(Manifest manifest) {
        Hashtable<String, String> headers = new Hashtable<String, String>();
        Attributes mainatts = manifest.getMainAttributes();
        for (Object key : mainatts.keySet()) {
            String name = key.toString();
            String value = mainatts.getValue(name);
            headers.put(name, value);
        }
        return headers;
View Full Code Here


     * Return a mutable dictionary of manifest headers
     */
    public Dictionary<String, String> getHeaders() {
        Hashtable<String, String> headers = new Hashtable<String, String>();
        Attributes mainAttributes = manifest.getMainAttributes();
        for (Object key : mainAttributes.keySet()) {
            Name name = (Name) key;
            String value = mainAttributes.getValue(name);
            headers.put(name.toString(), value);
        }
        return headers;
View Full Code Here

                }

                libraries.add(Utils.fileToURL(entryFile));
            }
        }
        for (Object o : attr.keySet()) {
            this.attr.put(o.toString(), attr.getValue(o.toString()));
        }
    }

    /**
 
View Full Code Here

                info += "    SIG=" + t + "\n";
            }
            info += "]" + "\n";

            info += "[Headers: " + "\n";
            for (Object key : mainAttributes.keySet()) {
                info += "    " + key + "=" + mainAttributes.get(key) + "\n";
            }
            info += "]" + "\n";

            // surround
View Full Code Here

   * @throws IOException
   */
  public void mergeManifest(Manifest manifest) throws IOException {
    if (manifest != null) {
      Attributes attributes = manifest.getMainAttributes();
      for (Iterator i = attributes.keySet().iterator(); i.hasNext();) {
        Name name = (Name) i.next();
        String key = name.toString();
        // Dont want instructions
        if (key.startsWith("-"))
          continue;
View Full Code Here

      try {
        JarFile jar = new JarFile(new File(string));
        Manifest manifest = jar.getManifest();
        Map<String, Attributes> entries = manifest.getEntries();
        Attributes v = manifest.getMainAttributes();
        for (Object k : v.keySet()) {
          System.out.println(k + ": " + v.get(k));
        }
        for (String a : entries.keySet()) {
          v = entries.get(a);
          for (Object k : v.keySet()) {
View Full Code Here

        for (Object k : v.keySet()) {
          System.out.println(k + ": " + v.get(k));
        }
        for (String a : entries.keySet()) {
          v = entries.get(a);
          for (Object k : v.keySet()) {
            System.out.println(a + k + ": " + v.get(k));
          }
        }
      } catch (IOException e) {
        System.out.println(e.getMessage());
View Full Code Here

            if (manifest == null)
                return;

            Map map = manifest.getEntries();
            Attributes attrs = manifest.getMainAttributes();
            Set<Object> keys = attrs.keySet();

            for (Object key : keys)
            {
                String value = (String) attrs.get (key);
View Full Code Here

     * Return a mutable dictionary of manifest headers
     */
    public Dictionary<String, String> getHeaders() {
        Hashtable<String, String> headers = new Hashtable<String, String>();
        Attributes mainAttributes = manifest.getMainAttributes();
        for (Object key : mainAttributes.keySet()) {
            Name name = (Name) key;
            String value = mainAttributes.getValue(name);
            headers.put(name.toString(), value);
        }
        return headers;
View Full Code Here

      try
      {
        JarFile jarFile = new JarFile(filePath);
        Attributes attributes = jarFile.getManifest().getMainAttributes();
       
        for(Object keyEntry : attributes.keySet())
        {
          String key = keyEntry.toString();
          String value = attributes.getValue(key);
         
          attributes_.put(key, value);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.