Package org.apache.oodt.cas.metadata

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


   * @throws IOException
   *           If there is an IO problem opening the met file.
   */
  public Metadata readMetFile(String file) throws InstantiationException,
      FileNotFoundException, IOException {
    SerializableMetadata metadata = new SerializableMetadata("UTF-8", false);
    metadata.loadMetadataFromXmlStream(new FileInputStream(config
        .getMetAreaPath()
        + "/" + file));

    return metadata;
  }
View Full Code Here


   * @throws IOException
   *           If there is an IO exception writing the {@link File}.
   */
  public void writeMetFile(String id, Metadata metadata)
      throws FileNotFoundException, IOException {
    SerializableMetadata serMet = new SerializableMetadata(metadata, "UTF-8",
        false);
    serMet.writeMetadataToXmlStream(new FileOutputStream(new File(config
        .getMetAreaPath(), id + config.getMetExtension())));
  }
View Full Code Here

            throw new MetExtractionException("Met file: [" + metFileFullPath
                    + "] does not exist: failing!");
        }

        try {
            SerializableMetadata met = new SerializableMetadata("UTF-8", false);
            met.loadMetadataFromXmlStream(new FileInputStream(metFileFullPath));
            return met;
        } catch (Exception e) {
            e.printStackTrace();
            throw new MetExtractionException(e.getMessage());
        }
View Full Code Here

                    "Met extractor failed to create metadata file");
        } else {
            LOG.log(Level.INFO, "Met extraction successful for product file: ["
                    + file.getAbsolutePath() + "]");
            try {
                SerializableMetadata sm = new SerializableMetadata("UTF-8",
                        false);
                sm.loadMetadataFromXmlStream(new FileInputStream(metFile));
                return sm;
            } catch (Exception e) {
                e.printStackTrace();
                throw new MetExtractionException(e.getMessage());
            }
View Full Code Here

      }

      Metadata met = null;
     
      try {
          met = new SerializableMetadata(new File(PathUtils
                  .replaceEnvVariables(((CopyAndRewriteConfig) this.config)
                          .getProperty("orig.met.file.path"))).toURL()
                  .openStream());
      } catch (Exception e) {
          e.printStackTrace();
View Full Code Here

      extractFilePath = args[0].replaceAll("\\\\", "");
      configFilePath = args[1];

      Metadata met = extractor.extractMetadata(new File(extractFilePath),
              configFilePath);
      XMLUtils.writeXmlToStream(new SerializableMetadata(met).toXML(),
              getMetFileOutputStream(extractFilePath));
  }
View Full Code Here

      extractFilePath = args[0].replaceAll("\\\\", "");
      configFilePath = args[1];

      Metadata met = extractor.extractMetadata(new File(extractFilePath),
              configFilePath);
      XMLUtils.writeXmlToStream(new SerializableMetadata(met).toXML(), os);

  }
View Full Code Here

            TransformerFactory transFact = TransformerFactory.newInstance();
            Transformer trans = transFact.newTransformer(xsltSource);
            boolean useCDATA = customArgs.length > 1 ? ((String) customArgs[1])
                    .toLowerCase().equals("true") : false;
            Source xmlSource = new DOMSource((new SerializableMetadata(
                    inputMetadata,
                    trans.getOutputProperty(OutputKeys.ENCODING), useCDATA))
                    .toXML());

            trans.setOutputProperty(OutputKeys.INDENT, "yes");
View Full Code Here

          }
        };
        refLink.setPopupSettings(refSettings);
        prodItem.add(refLink);

        SerializableMetadata met = new SerializableMetadata(fm
            .getMetadata(prodItem.getModelObject()));
        Link<String> metLink = new Link<String>("met_page_link", new Model(
            prodItem.getModelObject().getProductId())) {

          /*
 
View Full Code Here

                args);
    }
   
    protected void writeFromMetadata(Metadata metadata, String toMetFilePath)
        throws FileNotFoundException, IOException {
    new SerializableMetadata(metadata, "UTF-8", false)
        .writeMetadataToXmlStream(new FileOutputStream(toMetFilePath));
  }
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.