Package org.apache.oodt.cas.metadata

Examples of org.apache.oodt.cas.metadata.SerializableMetadata


  private static void addMetFileToProductZip(Metadata productMet,
      String metFileBaseName, ZipOutputStream out) throws Exception {

    // get the product metadata, and add its met file to the stream
    ByteArrayOutputStream metOut = new ByteArrayOutputStream();
    SerializableMetadata serialMet = new SerializableMetadata(productMet);
    serialMet.writeMetadataToXmlStream(metOut);
    ByteArrayInputStream metIn = new ByteArrayInputStream(metOut.toByteArray());
    String metFileName = metFileBaseName + ".met";
    addZipEntryFromStream(metIn, out, metFileName);
  }
View Full Code Here


                    metConfFilePath));
        } else {
            String productID = null;
            if (metFilePath != null) {
                productID = ingester.ingest(new URL(fmUrlStr), new File(
                        filePath), new SerializableMetadata(
                        new FileInputStream(metFilePath)));
            } else {
                extractor = GenericMetadataObjectFactory
                        .getMetExtractorFromClassName(extractorClassName);
                productID = ingester.ingest(new URL(fmUrlStr), new File(
View Full Code Here

        return met;
    }

    private void writeMetFileToDir(Metadata met, String fullMetFilePath) {
        try {
            XMLUtils.writeXmlFile(new SerializableMetadata(met).toXML(), fullMetFilePath);
        } catch (Exception e) {
            LOG.log(Level.WARNING, "Met file not generated: reason: "
                    + e.getMessage(), e);
        }
    }
View Full Code Here

    }

    public void writeToPropEqValFile(String filePath,
            String[] metadataToWriteOut) throws IOException {
        try {
            SerializableMetadata sMetadata = new SerializableMetadata("UTF-8",
                    false);
            for (String metadataKey : metadataToWriteOut)
                if (this.metadata.getMetadata(metadataKey) != null
                        && !this.metadata.getMetadata(metadataKey).equals(""))
                    sMetadata.addMetadata(metadataKey, this.metadata
                            .getMetadata(metadataKey));
            sMetadata.writeMetadataToXmlStream(new FileOutputStream(filePath));
        } catch (Exception e) {
            throw new IOException("Failed to write metadata file for "
                    + this.pFile + " : " + e.getMessage());
        }
    }
View Full Code Here

            VersioningUtils.addRefsFromUris(product, refs);

            try {
                Metadata metadata = null;
                URL metaUrl = new File(new URI(metadataFileName)).toURL();
                metadata = new SerializableMetadata(metaUrl.openStream());
                System.out.println("ingestProduct: Result: "
                        + client.ingestProduct(product, metadata,
                                clientTransfer));
            } catch (Exception e) {
                e.printStackTrace();
View Full Code Here

        try {
            URL ingestUrl = this.getClass().getResource("/ingest");
            URL refUrl = this.getClass().getResource("/ingest/test.txt");
            URL metUrl = this.getClass().getResource("/ingest/test.txt.met");

            prodMet = new SerializableMetadata(new FileInputStream(
                new File(metUrl.getFile())));

            // now add the right file location
            prodMet.addMetadata(CoreMetKeys.FILE_LOCATION, new File(
                ingestUrl.getFile()).getCanonicalPath());
View Full Code Here

        try {
            URL ingestUrl = this.getClass().getResource("/ingest");
            URL refUrl = this.getClass().getResource("/ingest/test.txt");
            URL metUrl = this.getClass().getResource("/ingest/test.txt.met");

            prodMet = new SerializableMetadata(new FileInputStream(
                new File(metUrl.getFile())));

            // now add the right file location
            prodMet.addMetadata(CoreMetKeys.FILE_LOCATION, new File(
                ingestUrl.getFile()).getCanonicalPath());
View Full Code Here

        try {
            URL ingestUrl = this.getClass().getResource("/ingest");
            URL refUrl = this.getClass().getResource("/ingest/test.txt");
            URL metUrl = this.getClass().getResource("/ingest/test.txt.met");

            prodMet = new SerializableMetadata(new FileInputStream(
                new File(metUrl.getFile())));

            // now add the right file location
            prodMet.addMetadata(CoreMetKeys.FILE_LOCATION, new File(
                ingestUrl.getFile()).getCanonicalPath());
View Full Code Here

        try {
            URL ingestUrl = this.getClass().getResource("/ingest");
            URL refUrl = this.getClass().getResource("/ingest/test.txt");
            URL metUrl = this.getClass().getResource("/ingest/test.txt.met");

            prodMet = new SerializableMetadata(new FileInputStream(
                new File(metUrl.getFile())));

            // now add the right file location
            prodMet.addMetadata(CoreMetKeys.FILE_LOCATION, new File(
                ingestUrl.getFile()).getCanonicalPath());
View Full Code Here

        try {
            URL ingestUrl = this.getClass().getResource("/ingest");
            URL refUrl = this.getClass().getResource("/ingest/test.txt");
            URL metUrl = this.getClass().getResource("/ingest/test.txt.met");

            prodMet = new SerializableMetadata(new FileInputStream(
                new File(metUrl.getFile())));

            // now add the right file location
            prodMet.addMetadata(CoreMetKeys.FILE_LOCATION, new File(
                ingestUrl.getFile()).getCanonicalPath());
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.metadata.SerializableMetadata

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.