Examples of Manifest


Examples of java.util.jar.Manifest

  
   <P>If none of these appear, simply return an empty String.
  */
  private String fetchSpecNamesAndVersions(JarInputStream aJarStream) {
    StringBuffer result = new StringBuffer();
    Manifest manifest = aJarStream.getManifest();
    if ( manifest != null ){
      Attributes attrs = (Attributes)manifest.getMainAttributes();
      for (Iterator iter = attrs.keySet().iterator(); iter.hasNext(); ) {
        Attributes.Name attrName = (Attributes.Name)iter.next();
        addSpecAttrIfPresent(SPECIFICATION_TITLE, result, attrs, attrName);
        addSpecAttrIfPresent(SPECIFICATION_VERSION, result, attrs, attrName);
      }
View Full Code Here

Examples of java.util.jar.Manifest

    try {
      jarFile = new JarFile(file);

      // Load the manifest
      InputStream in = jarFile.getInputStream(jarFile.getEntry("META-INF/MANIFEST.MF"));
      Manifest manifest = new Manifest(in);
      in.close();

      // Read the class names
      Attributes attributes = manifest.getMainAttributes();
      String classNameCsv = attributes.getValue("Preparator-Classes");
      if (classNameCsv == null) {
        throw new RegainException("The manifest in preparator file '" + file
            + "' has no 'Preparator-Classes' attribute");
      }
View Full Code Here

Examples of java.util.jar.Manifest

    Attributes getAttributes() throws IOException
    {
        if (attributes == null)
        {
            final Manifest man = ((JarFile) getZipFile()).getManifest();
            if (man == null)
            {
                attributes = new Attributes(1);
            }
            else
            {
                attributes = man.getMainAttributes();
                if (attributes == null)
                {
                    attributes = new Attributes(1);
                }
            }
View Full Code Here

Examples of java.util.jar.Manifest

  URL url = res.getCodeSourceURL();
  if (i != -1) {
      String pkgname = name.substring(0, i);
      // Check if package already loaded.
      Package pkg = getPackage(pkgname);
      Manifest man = res.getManifest();
      if (pkg != null) {
    // Package found, so check package sealing.
    if (pkg.isSealed()) {
        // Verify that code source URL is the same.
        if (!pkg.isSealed(url)) {
View Full Code Here

Examples of java.util.jar.Manifest

        }
    }
    // Convert to "."-separated package name
    name = name.substring(0, name.length() - 1).replace('/', '.');
    Package pkg;
    Manifest man = (Manifest)mans.get(fn);
    if (man != null) {
        pkg = new Package(name, man, url, null);
    } else {
        pkg = new Package(name, null, null, null,
              null, null, null, null, null);
View Full Code Here

Examples of java.util.jar.Manifest

     */
    private static Manifest loadManifest(String fn) {
  try {
      FileInputStream fis = new FileInputStream(fn);
      JarInputStream jis = new JarInputStream(fis, false);
      Manifest man = jis.getManifest();
      jis.close();
      return man;
  } catch (IOException e) {
      return null;
  }
View Full Code Here

Examples of java.util.jar.Manifest

      File file = new File(userDir, "jboss-messaging.jar");
      assertTrue(file.exists());

      // Open the jar and load MANIFEST.MF
      JarFile jar = new JarFile(file);
      Manifest manifest = jar.getManifest();
     
      // Open a connection and get ConnectionMetaData
      InitialContext ic = new InitialContext(ServerManagement.getJNDIEnvironment());
      ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
      Connection conn = cf.createConnection();
      assertNotNull(conn);
      ConnectionMetaData meta = conn.getMetaData();
     
      // Compare the value from ConnectionMetaData and MANIFEST.MF
      Attributes attrs = manifest.getMainAttributes();
     
      log.info("META--> " + meta.getJMSMajorVersion());
      log.info("META--> " + meta.getJMSMinorVersion());
      log.info("META--> " + meta.getJMSProviderName());
      log.info("META--> " + meta.getJMSVersion());
View Full Code Here

Examples of java.util.jar.Manifest

        }
    }

    private static void buildManifest(HashMap<String, String> argMap)
            throws Exception {
        Manifest m = new Manifest();
        Attributes a = m.getMainAttributes();
        a.put(Attributes.Name.MANIFEST_VERSION, "1.0");
        //a.put("Built-By", "manningr"); // argMap.get(BUILT_BY_KEY)
        a.put("Application-Version", argMap.get(VERSION_KEY));
        a.put(Attributes.Name.CLASS_PATH,
                "lib/antlr-2.7.5H3.jar "
                + "lib/commons-cli.jar "
                + "lib/commons-logging-1.0.4.jar "
                + "lib/forms.jar "
                + "lib/fw.jar "
                + "lib/hibernate3.jar "
                + "lib/jxl.jar "
                + "lib/log4j.jar "
                + "lib/nanoxml-2.1.jar "
                + "lib/openide.jar  "
                + "lib/openide-loaders.jar "
                + "lib/org-netbeans-modules-editor-fold.jar "
                + "lib/org-netbeans-modules-editor.jar "
                + "lib/org-netbeans-modules-editor-lib.jar "
                + "lib/org-netbeans-modules-editor-util.jar "
                + "lib/syntax.jar ");
        a.put(Attributes.Name.MAIN_CLASS,
              "net.sourceforge.squirrel_sql.client.Main");
        m.write(System.out);
    }
View Full Code Here

Examples of java.util.jar.Manifest

            showUsage();
            WrapperManager.stop( 1 );
            return// Will not get here
        }
       
        Manifest manifest;
        try
        {
            manifest = jarFile.getManifest();
        }
        catch ( IOException e )
        {
            m_outError.println( WrapperManager.getRes().getString(
                    "Unable to access the jar''s manifest file {0} : {1}", args[0], e ) );
            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() )
        {
View Full Code Here

Examples of java.util.jar.Manifest

    /**
     * Generate output JAR-file and packages
     */
    public void outputToJar() throws IOException {
  // create the manifest
  final Manifest manifest = new Manifest();
  final java.util.jar.Attributes atrs = manifest.getMainAttributes();
  atrs.put(java.util.jar.Attributes.Name.MANIFEST_VERSION,"1.2");

  final Map map = manifest.getEntries();
  // create manifest
  Enumeration classes = _bcelClasses.elements();
  final String now = (new Date()).toString();
  final java.util.jar.Attributes.Name dateAttr =
      new java.util.jar.Attributes.Name("Date");
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.