Package com.subhajit.build

Examples of com.subhajit.build.Manifest$Attribute


        // Create the project jar file.
        File projectJarFile = new File(zipDir, eclipseProject.getName()
            + ".jar");
        // Update the manifest.
        // If there is already a manifest file, load it.
        Manifest manifest = null;
        File manifestFile = new File(projectJarDir,
            "META-INF/MANIFEST.MF");
        if (manifestFile.exists()) {
          manifest = loadManifest(manifestFile);
        } else {
          manifest = CreateJarUtils.createDefaultManifest();
        }
        progress.increment(1, "Creating manifest files");
        if (manifest.getMainSection().getAttribute("Main-Class") != null) {
          manifest.getMainSection().removeAttribute("Main-Class");
        }
        manifest.getMainSection().addConfiguredAttribute(
            new Manifest.Attribute("Main-Class", mainClass));
        FileUtils.mkdirs(manifestFile.getParentFile());
        saveManifest(manifestFile, manifest);

        // Create the jar.
View Full Code Here


  private static Manifest loadManifest(File manifestFile) throws IOException,
      ManifestException {
    StringReader reader = null;
    try {
      reader = new StringReader(FileUtils.loadTextFile(manifestFile));
      return new Manifest(reader);
    } finally {
      if (reader != null) {
        reader.close();
      }
    }
View Full Code Here

  static final URL[] ZERO_LENGTH_URL_ARRAY = new URL[0];

  protected static Manifest createManifest(EclipseProject project,
      String mainClass) throws ManifestException, IOException,
      JDOMException, InterruptedException {
    Manifest ret = createDefaultManifest();

    if (mainClass != null) {
      ret.addConfiguredAttribute(new Manifest.Attribute("Main-Class",
          mainClass));
    }

    // Get all classpath elements.
    StringBuilder str = new StringBuilder();
    for (EclipseMetafile metafile : project.getAllDependants()) {
      if (metafile instanceof CompiledJar) {
        if (str.length() != 0) {
          str.append(" ");
        }
        str.append(((CompiledJar) metafile).getFile().getName());
      }
    }
    ret.addConfiguredAttribute(new Manifest.Attribute("Class-Path", str
        .toString()));
    return ret;
  }
View Full Code Here

        .toString()));
    return ret;
  }

  static Manifest createDefaultManifest() throws ManifestException {
    Manifest ret = new Manifest();
    ret.addConfiguredAttribute(new Manifest.Attribute("Manifest-Version",
        "1.0"));
    ret.addConfiguredAttribute(new Manifest.Attribute("Archiver-Version",
        "Subhajit's eclipse plugin."));
    ret.addConfiguredAttribute(new Manifest.Attribute("Created-By",
        "ClassTools plugin."));
    return ret;
  }
View Full Code Here

   */
  protected static void createManifestFiles(File outputDirectory,
      EclipseProject project, String mainClass, IProgress... progresses)
      throws ManifestException, IOException, JDOMException,
      InterruptedException {
    Manifest manifest = createManifest(project, mainClass);
    saveManifest(outputDirectory, manifest);
  }
View Full Code Here

      throw new IllegalArgumentException("Run directory not given.");
    }

    // Export the process-manager.jar file to the "dir" directory.
    Class<?> klass = ProcessManagerMain.class;
    Manifest manifest = new Manifest();
    manifest.getMainSection().addConfiguredAttribute(
        new Manifest.Attribute("Premain-Class",
            ProcessManagerMain.class.getName()));
    DistributionManager.createDistributionWithAdditionalClasses(Thread
        .currentThread().getContextClassLoader(), new File(dir,
        "process-manager.jar"), manifest, klass.getName(),
View Full Code Here

                                {
                                    skey.textToShow = trans.get(f);
                                    f = org.size();
                                }

                            Attribute a;
                            if ((a = keyEl.getAttribute(length)) != null)
                                skey.keyWidth = Integer.parseInt(a.getValue());

                            line.add(skey);
                        } else
                            line.add(SpecialKey.getKeyboardKey(fontName, special));
                    }
View Full Code Here

    this.handleQCInformation();

    this.ncFile.addAttribute( null, qcFlagsAtt );

    // Add some general metadata in global attributes.
    this.ncFile.addAttribute( null, new Attribute( "title",
                                                   new StringBuffer("NGDC archived ")
                                                   .append( datasetIdAtt.getStringValue())
                                                   .append( " data with start time ")
                                                   .append( startDateAtt.getStringValue())
                                                   .toString()));
    this.ncFile.addAttribute( null, new Attribute( "Convention", _Coordinate.Convention));

    // Add some THREDDS specific metadata in global attributes.
    this.ncFile.addAttribute( null, new Attribute( "thredds_creator", "DOD/USAF/SMC > Space and Missile Systems Center (SMC), U.S. Air Force, U.S. Department of Defense"));
    this.ncFile.addAttribute( null, new Attribute( "thredds_contributor", "DOC/NOAA/NESDIS/NGDC > National Geophysical Data Center, NESDIS, NOAA, U.S. Department of Commerce"));
    this.ncFile.addAttribute( null, new Attribute( "thredds_contributor_role", "archive"));
    this.ncFile.addAttribute( null, new Attribute( "thredds_publisher", "DOC/NOAA/NESDIS/NGDC > National Geophysical Data Center, NESDIS, NOAA, U.S. Department of Commerce"));
    this.ncFile.addAttribute( null, new Attribute( "thredds_publisher_url", "http://dmsp.ngdc.noaa.gov/"));
    this.ncFile.addAttribute( null, new Attribute( "thredds_publisher_email", "ngdc.dmsp@noaa.gov"));
    this.ncFile.addAttribute( null, new Attribute( "thredds_summary",
                                                   new StringBuffer("This dataset contains data from the DMSP ").append( spacecraftIdAtt.getStringValue())
                                                   .append( " satellite OLS instrument and includes both visible smooth and thermal smooth imagery with 2.7km resolution.")
                                                   .append( " The start time for this data is ").append( startDateAtt.getStringValue())
                                                   .append( " and the northerly equatorial crossing longitude is ").append( startLongitudeAtt.getNumericValue())
                                                   .append( ".  The DMSP satellite is a polar-orbiting satellite crossing the equator, depending on the satellite, at either dawn/dusk or noon/midnight.")
                                                   .append( " This data is in the NOAA/NGDC DMSP archive format.")
                                                   .toString()));
    this.ncFile.addAttribute( null, new Attribute( "thredds_history", ""));
    this.ncFile.addAttribute( null, new Attribute( "thredds_timeCoverage_start", startDateAtt.getStringValue()));
    this.ncFile.addAttribute( null, new Attribute( "thredds_timeCoverage_end", endDateAtt.getStringValue()));
    this.ncFile.addAttribute( null, new Attribute( "thredds_geospatialCoverage",
                                                   new StringBuffer("Polar orbit with northerly equatorial crossing at longitude ")
                                                   .append( ascendingNodeAtt.getNumericValue()).append( ".")
                                                   .toString()));

View Full Code Here

   * @throws IOException if any problems reading the file (or validating the file).
   */
  private void handleFileInformation()
          throws IOException
  {
    fileIdAtt = new Attribute( this.fileIdAttName,
                               (String) headerInfo.get( HeaderInfoTitle.FILE_ID.toString() ) );
    datasetIdAtt = new Attribute( this.datasetIdAttName,
                                  (String) headerInfo.get( HeaderInfoTitle.DATA_SET_ID.toString() ) );
    recordSizeInBytes = Integer.parseInt( (String) headerInfo.get( HeaderInfoTitle.RECORD_BYTES.toString() ) );
    numRecords = Integer.parseInt( (String) headerInfo.get( HeaderInfoTitle.NUM_RECORDS.toString() ) );
    numHeaderRecords = Integer.parseInt( (String) headerInfo.get( HeaderInfoTitle.NUM_HEADER_RECORDS.toString() ) );
    numDataRecords = Integer.parseInt( (String) headerInfo.get( HeaderInfoTitle.NUM_DATA_RECORDS.toString() ) );
View Full Code Here

   * @throws IOException if any problems reading the file (or validating the file).
   */
  private void handleProcessingInformation()
          throws IOException
  {
    suborbitHistoryAtt = new Attribute( this.suborbitHistoryAttName,
                                        (String) headerInfo.get( HeaderInfoTitle.SUBORBIT_HISTORY.toString() ) );
    processingSystemAtt = new Attribute( this.processingSystemAttName,
                                         (String) headerInfo.get( HeaderInfoTitle.PROCESSING_SYSTEM.toString() ) );
    String processingDateString = (String) headerInfo.get( HeaderInfoTitle.PROCESSING_DATE.toString() );
    try
    {
      processingDate = DateFormatHandler.ALT_DATE_TIME.getDateFromDateTimeString( processingDateString );
    }
    catch ( ParseException e )
    {
      throw new IOException( "Invalid DMSP file: processing date string <" + processingDateString + "> not parseable: " + e.getMessage() );
    }
    processingDateAtt = new Attribute(
            this.processingDateAttName,
            DateFormatHandler.ISO_DATE_TIME.getDateTimeStringFromDate( processingDate ) );
  }
View Full Code Here

TOP

Related Classes of com.subhajit.build.Manifest$Attribute

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.