Package java.util.jar

Examples of java.util.jar.Attributes$Name


            showUsage();
            WrapperManager.stop( 1 );
            return// Will not get here
        }
       
        Attributes attributes = manifest.getMainAttributes();
        String mainClassName = attributes.getValue( "Main-Class" );
        String classPath = attributes.getValue( "Class-Path" );

        if ( WrapperManager.isDebugEnabled() )
        {
            m_outDebug.println( "Jar Main-Class: " + mainClassName );
        }
View Full Code Here


      {
         return null;
      }

      Manifest mf = VFSUtils.readManifest(file);
      Attributes attrs = mf.getMainAttributes();
      String className = attrs.getValue(Attributes.Name.MAIN_CLASS);
      return className;
   }
View Full Code Here

      String mainClassName = "org.jboss.client.AppClientMain";

      if (file != null)
      {
         Manifest mf = VFSUtils.readManifest(file);
         Attributes attrs = mf.getMainAttributes();
         String className = attrs.getValue(Attributes.Name.MAIN_CLASS);
         if (className != null)
         {
            mainClassName = className;
         }
      }
View Full Code Here

      {
         return null;
      }

      Manifest mf = VFSUtils.readManifest(file);
      Attributes attrs = mf.getMainAttributes();
      return attrs.getValue(Attributes.Name.MAIN_CLASS);
   }
View Full Code Here

            type = J2eeModuleMetaData.CLIENT;
         }
         else if( mfFile != null )
         {
            Manifest mf = VFSUtils.readManifest(mfFile);
            Attributes attrs = mf.getMainAttributes();
            if( attrs.containsKey(Attributes.Name.MAIN_CLASS) )
            {
               type = J2eeModuleMetaData.CLIENT;
            }
            else
            {
View Full Code Here

      }
      finally
      {
         is.close();
      }
      Attributes attrs = mf.getMainAttributes();
      String mainClassName = attrs.getValue(Attributes.Name.MAIN_CLASS);        
      return mainClassName;
   }
View Full Code Here

            type = J2eeModuleMetaData.CLIENT;
         }
         else if( mfFile != null )
         {
            Manifest mf = VFSUtils.readManifest(mfFile);
            Attributes attrs = mf.getMainAttributes();
            if( attrs.containsKey(Attributes.Name.MAIN_CLASS) )
            {
               type = J2eeModuleMetaData.CLIENT;
            }
            else
            {
View Full Code Here

            throw new FileNotFoundException("Not a JarFile: "+file);
         }

         Manifest tmpMf = jarFile.getManifest();
         this.mf = tmpMf == null ? new Manifest() : tmpMf;
         Attributes mfAttrs = mf.getMainAttributes();

         String sealedAttr = mfAttrs.getValue(Attributes.Name.SEALED);
         sealed = Boolean.valueOf(sealedAttr).booleanValue();

         specVersion = mfAttrs.getValue(Attributes.Name.SPECIFICATION_VERSION);
         if( specVersion == null )
         {
            specVersion = release.specVersion;
            mfAttrs.put(Attributes.Name.SPECIFICATION_VERSION, specVersion);
         }
         specVendor = mfAttrs.getValue(Attributes.Name.SPECIFICATION_VENDOR);
         if( specVendor == null )
         {
            specVendor = release.specVendor;
            mfAttrs.put(Attributes.Name.SPECIFICATION_VENDOR, specVendor);
         }
         specTitle = mfAttrs.getValue(Attributes.Name.SPECIFICATION_TITLE);
         if( specTitle == null )
         {
            specTitle = release.specTitle;
            mfAttrs.put(Attributes.Name.SPECIFICATION_TITLE, specTitle);
         }

         implTitle = mfAttrs.getValue(Attributes.Name.IMPLEMENTATION_TITLE);
         if( implTitle == null )
         {
            implTitle = release.implTitle;
            mfAttrs.put(Attributes.Name.IMPLEMENTATION_TITLE, implTitle);
         }
         implVersion = mfAttrs.getValue(Attributes.Name.IMPLEMENTATION_VERSION);
         if( implVersion == null )
         {
            implVersion = release.implVersion;
            mfAttrs.put(Attributes.Name.IMPLEMENTATION_VERSION, implVersion);
         }
         implVendor = mfAttrs.getValue(Attributes.Name.IMPLEMENTATION_VENDOR);
         if( implVendor == null )
         {
            implVendor = release.implVendor;
            mfAttrs.put(Attributes.Name.IMPLEMENTATION_VENDOR, implVendor);
         }
         implVendorID = mfAttrs.getValue(Attributes.Name.IMPLEMENTATION_VENDOR_ID);
         if( implVendorID == null )
         {
            implVendorID = release.implVendorID;
            mfAttrs.put(Attributes.Name.IMPLEMENTATION_VENDOR_ID, implVendorID);
         }
         implURL = mfAttrs.getValue(Attributes.Name.IMPLEMENTATION_URL);
         if( implURL == null )
         {
            implURL = release.implURL;
            mfAttrs.put(Attributes.Name.IMPLEMENTATION_URL, implURL);
         }
      }
View Full Code Here

    {
      // TODO Auto-generated catch block
      e1.printStackTrace();
      return null;
    }
    Attributes attr = manifest.getMainAttributes();

    String cl = attr.getValue("Class-Path-" + type);
    if (cl == null)
      return null;

    ArrayList classpath = new ArrayList();
    classpath.add(new File(wrapperJar));
View Full Code Here

    catch (IOException e1)
    {
      e1.printStackTrace();
      return null;
    }
    Attributes attr = manifest.getMainAttributes();

    String cl = attr.getValue("Class-Path");
    ClassLoader loader = null;
    if (cl != null)
    {
      ArrayList classpath = new ArrayList();
      String[] clArr = cl.split(" ");
      for (int i = 0; i < clArr.length; i++)
      {
        String file = clArr[i];
        File myFile;
        try
        {
          myFile = new File(file);
          classpath.add(myFile);
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }
      }

      URL[] urlsArr = new URL[classpath.size()];
      int i = 0;
      for (Iterator it = classpath.iterator(); it.hasNext(); i++)
        try
        {
          urlsArr[i] = ((File) it.next()).toURI().toURL();
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }

      loader = new URLClassLoader(urlsArr, ClassLoader.getSystemClassLoader());
    }
    if (loader == null)
      loader = ClassLoader.getSystemClassLoader();

    String mainClassName = attr.getValue("Main-Class");
    if (mainClassName == null)
      return null;
    Method mainMethod = null;
    try
    {
View Full Code Here

TOP

Related Classes of java.util.jar.Attributes$Name

Copyright © 2018 www.massapicom. 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.