Package java.util.jar

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


   * @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


                    MBeanServer mserver=Registry.getRegistry().getMBeanServer();
                    if( ! mserver.isRegistered(oname ) ) {
                        mserver.registerMBean(proxy, oname);
                    }
                }
                Iterator it2=attrs.keySet().iterator();
                while( it2.hasNext() ) {
                    Object o=it2.next();
                    String att=(o==null) ? null : o.toString();
                    if( "modelerType".equals( att )) continue;
                    String val=attrs.getValue(att);
View Full Code Here

  public void applyAttributes(final java.util.jar.Manifest manifest) {
    ManifestBuilder.setGlobalAttributes(manifest.getMainAttributes());
    final Attributes mainAttributes = manifest.getMainAttributes();

    List<Object> keys = new ArrayList<Object>(mainAttributes.keySet());
    Collections.sort(keys, new Comparator<Object>() {
      public int compare(final Object o1, final Object o2) {
        Attributes.Name name1 = (Attributes.Name)o1;
        Attributes.Name name2 = (Attributes.Name)o2;
        return name1.toString().compareTo(name2.toString());
View Full Code Here

        final ManifestEntry jar = new ManifestEntry(name, null);
        manifestTree.add(jar);

        final Manifest manifest = new Manifest(url.openStream());
        final Attributes attributes = manifest.getMainAttributes();
        for (final Object key : attributes.keySet()) {
          jar.add(new ManifestEntry(key.toString(), attributes.get(key).toString()));
        }
      }
    } catch (final IOException e) {
      LOG.error("Problem while processing URL: " + url, e);
View Full Code Here

   
    private ManifestUtils(){}

    public static Map<String,String> manifestToProperties(Manifest m) {
        Attributes mainAttributes = m.getMainAttributes();
        Iterator iter = mainAttributes.keySet().iterator();
        Map<String,String> result = new LinkedHashMap<String,String>();
        while (iter.hasNext()) {
            Attributes.Name attrName = (Attributes.Name) iter.next();
            String key = attrName.toString();
            String val = (String) mainAttributes.get(attrName);
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

 
  private static boolean removeDigestAttributes(Manifest manifest) {
      boolean foundDigestAttribute = false;
      for (Map.Entry<String, Attributes> entry : manifest.getEntries().entrySet()) {
          Attributes attributes = entry.getValue();
          for (Object attributeName : attributes.keySet()) {   
              String name = ((Attributes.Name) attributeName).toString();
              name = name.toLowerCase();
              if (name.endsWith("-digest") || name.contains("-digest-")) {
                  attributes.remove(attributeName);
                  foundDigestAttribute = true;
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

    // Remove all the headers mentioned in -removeheaders
    Map removes = parseHeader(getProperty(REMOVE_HEADERS));
    for (Iterator i = removes.keySet().iterator(); i.hasNext();) {
      String header = (String) i.next();
      for (Iterator j = main.keySet().iterator(); j.hasNext();) {
        Attributes.Name attr = (Attributes.Name) j.next();
        if (attr.toString().matches(header)) {
          j.remove();
          progress("Removing header: " + header);
        }
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

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.