Package java.util.jar.Attributes

Examples of java.util.jar.Attributes.Name


            JarFile s4rFile = new JarFile(s4r);
            if (s4rFile.getManifest() == null) {
                logger.warn("Cannot load s4r archive [{}] : missing manifest file");
                return;
            }
            if (!s4rFile.getManifest().getMainAttributes().containsKey(new Name(MANIFEST_S4_APP_CLASS))) {
                logger.warn("Cannot load s4r archive [{}] : missing attribute [{}] in manifest", s4r.getAbsolutePath(),
                        MANIFEST_S4_APP_CLASS);
                return;
            }
            String appClassName = s4rFile.getManifest().getMainAttributes().getValue(MANIFEST_S4_APP_CLASS);
View Full Code Here


  }

  public Manifest getManifest(boolean shouldCreate) {
    if (manifest == null && shouldCreate) {
      String WEAVER_MANIFEST_VERSION = "1.0";
      Attributes.Name CREATED_BY = new Name("Created-By");
      String WEAVER_CREATED_BY = "AspectJ Compiler";

      manifest = new Manifest();

      Attributes attributes = manifest.getMainAttributes();
View Full Code Here

      logger.log(Level.FINE, "writing {0}", new Object[]{ destJar });
  }
  Attributes atts = manifest.getMainAttributes();
        if (atts.get(Name.MANIFEST_VERSION) == null)
      atts.put(Name.MANIFEST_VERSION, "1.0");
        Name creatorName = new Name("Created-By");
        if (atts.get(creatorName) == null )
      atts.put(creatorName, JarWrapper.class.getName());
        if (atts.get(Name.CLASS_PATH) == null)
      atts.put(Name.CLASS_PATH, classPath.toString());
        if ((atts.get(Name.MAIN_CLASS) == null) && (mainClass != null)) {
View Full Code Here

  }

  public Manifest getManifest(boolean shouldCreate) {
    if (manifest == null && shouldCreate) {
      String WEAVER_MANIFEST_VERSION = "1.0";
      Attributes.Name CREATED_BY = new Name("Created-By");
      String WEAVER_CREATED_BY = "AspectJ Compiler";

      manifest = new Manifest();

      Attributes attributes = manifest.getMainAttributes();
View Full Code Here

   */
  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("-"))
          continue;

        if (getProperty(key) == null)
View Full Code Here

    Manifest manifest = new Manifest();
    Attributes mainAttributes = manifest.getMainAttributes();

    // Create manifest stating that agent is allowed to transform classes
    mainAttributes.put(Name.MANIFEST_VERSION, "1.0");
    mainAttributes.put(new Name("Agent-Class"), agent_.getName());
    mainAttributes.put(new Name("Can-Retransform-Classes"), "true");
    mainAttributes.put(new Name("Can-Redefine-Classes"), "true");
    //    if (jars_.size() > 0) {
    //      StringBuilder sb = new StringBuilder();
    //      sb.append('.');
    //      for (int i = 0; i < jars_.size(); i++) {
    //        sb.append(", jar/");
View Full Code Here

   */
  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("-"))
          continue;

        if (getProperty(key) == null)
View Full Code Here

    Iterator i;
    Map.Entry e;
    for (i = attr.entrySet().iterator(); i.hasNext();)
      {
        e = (Map.Entry) i.next();
        Name name = (Name) e.getKey();
        if (Name.SIGNATURE_VERSION.equals(name) || CREATED_BY.equals(name))
          continue;

        writeHeader(name.toString(), (String) e.getValue(), out);
      }
    out.write(CRLF);

    Iterator j;
    for (i = entries.entrySet().iterator(); i.hasNext();)
View Full Code Here

        } else if (hint instanceof String) {
            datasourceName = (String) hint;
            //datasourceName = GeoTools.fixName(datasourceName);
            hints.put(Hints.EPSG_DATA_SOURCE, datasourceName);
        } else if (hint instanceof Name) {
            Name name = (Name) hint;
            hints.put(Hints.EPSG_DATA_SOURCE, name);
            datasourceName = name.toString();
            //datasourceName = GeoTools.fixName(name.toString());
        } else if (hint instanceof DataSource) {
            datasource = (DataSource) hint;
            hints.put(Hints.EPSG_DATA_SOURCE, datasource);
            datasourceName = DATASOURCE_NAME;
View Full Code Here

   */
  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("-"))
          continue;

        if (getProperty(key) == null)
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.