Package java.util.jar

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


            String[] removeHeaders = builder.getProperty( Constants.REMOVEHEADERS, "" ).split( "," );

            // apply -removeheaders to the custom manifest
            for ( int i = 0; i < removeHeaders.length; i++ )
            {
                for ( Iterator j = mainMavenAttributes.keySet().iterator(); j.hasNext(); )
                {
                    if ( j.next().toString().matches( removeHeaders[i].trim() ) )
                    {
                        j.remove();
                    }
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

                    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 String[] getMainClassArguments() {
        if (mf != null) {
            Attributes mainAttributes = mf.getMainAttributes();
            SortedMap<String, String> arg_map = new TreeMap<String, String>();
            for (Object key : mainAttributes.keySet()) {
                String s = String.valueOf(key);
                if (s.startsWith("Main-Class-Arg")) {
                    arg_map.put(s, String.valueOf(mainAttributes.get(key)));
                }
            }
View Full Code Here

        Set keys = new HashSet();
        Attributes existingMap = existingManifest.getMainAttributes();
        Attributes newMap = manifest.getMainAttributes();
        keys.addAll( existingMap.keySet() );
        keys.addAll( newMap.keySet() );
        Iterator iterator = keys.iterator();
        while ( iterator.hasNext() )
        {
            Attributes.Name key = (Attributes.Name) iterator.next();
            String newValue = (String) newMap.get( key );
View Full Code Here

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

        final Manifest manifest = new Manifest(url.openStream());
        final Attributes attributes = manifest.getMainAttributes();
        for (Object key : attributes.keySet()) {
          manifestList.add(new ManifestEntry("     " + key.toString(), attributes.get(key).toString()));
        }
      }
    } catch (IOException e) {
      LOG.error("Problem while processing URL: " + url, e);
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

        // Remove all the headers mentioned in -removeheaders
        Map<String, Map<String, String>> removes = parseHeader(getProperty(REMOVEHEADERS));
        for (Iterator<String> i = removes.keySet().iterator(); i.hasNext();) {
            String header = i.next();
            for (Iterator<Object> 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<Object> i = attributes.keySet().iterator(); i
                    .hasNext();) {
                Name name = (Name) i.next();
                String key = name.toString();
                // Dont want instructions
                if (key.startsWith("-"))
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.