Package org.apache.oodt.cas.metadata.exceptions

Examples of org.apache.oodt.cas.metadata.exceptions.MetExtractionException


   *
   * @see gov.nasa.jpl.oodt.cas.metadata.AbstractMetExtractor#extractMetadata(java.io.File)
   */
  public Metadata extrMetadata(File file) throws MetExtractionException {
      if (this.config == null) {
          throw new MetExtractionException(
                  "No config file defined: unable to copy and rewrite metadata!");
      }

      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();
          throw new MetExtractionException(
                  "error parsing original met file: ["
                          + ((CopyAndRewriteConfig) this.config)
                                  .getProperty("orig.met.file.path")
                          + "]: Message: " + e.getMessage());
      }
View Full Code Here


     *
     * @see org.apache.oodt.cas.metadata.MetExtractor#extractMetadata(java.io.File)
     */
    public Metadata extractMetadata(File f) throws MetExtractionException {
        if (f == null || !f.exists())
            throw new MetExtractionException("File '" + f + "' does not exist");
        return this.extrMetadata(this.safeGetCanonicalFile(f));
    }
View Full Code Here

     */
    public Metadata extractMetadata(URL fileUrl) throws MetExtractionException {
        try {
            return this.extractMetadata(this.safeGetFileFromUri(fileUrl));
        } catch (Exception e) {
            throw new MetExtractionException(
                    "Failed to extract metadata from URL '" + fileUrl + "' : "
                            + e.getMessage());
        }
    }
View Full Code Here

    public void setConfigFile(File f) throws MetExtractionException {
        try {
            this.setConfigFile(this.reader.parseConfigFile(this
                    .safeGetCanonicalFile(f)));
        } catch (Exception e) {
            throw new MetExtractionException("Failed to parse config file : "
                    + e.getMessage());
        }
    }
View Full Code Here

        else if (preconditionResult > 0)
            return NOT_EQUAL_TO.equals(opKey) || GREATER_THAN.equals(opKey);
        else if (preconditionResult < 0)
            return NOT_EQUAL_TO.equals(opKey) || LESS_THAN.equals(opKey);
        else
            throw new MetExtractionException("evalType is not a valid type");
    }
View Full Code Here

        if (product.getProductType() == null
                || (product.getProductType() != null && (product
                        .getProductType().getName() == null || (product
                        .getProductType().getName() != null && product
                        .getProductType().getName().equals(""))))) {
            throw new MetExtractionException("Product Type undefined");
        }

        if (product.getProductReferences() == null
                || (product.getProductReferences() != null && product
                        .getProductReferences().size() == 0)) {
            throw new MetExtractionException("Product references undefined");
        }

        /*
         * if (met == null || (met != null && (met.getHashtable() == null ||
         * (met .getHashtable() != null && met.getHashtable().keySet() .size() ==
View Full Code Here

                prodFile = new File(getRootRefPath(product
                        .getProductReferences(), product.getProductType()
                        .getProductRepositoryPath()));
            } catch (Exception e) {
                e.printStackTrace();
                throw new MetExtractionException("URI exception parsing: ["
                        + product.getRootRef().getOrigReference() + "]");
            }
        } else {
            try {
                prodFile = new File(new URI(((Reference) product
                        .getProductReferences().get(0)).getOrigReference()));
            } catch (Exception e) {
                throw new MetExtractionException("URI exception parsing: ["
                        + ((Reference) product.getProductReferences().get(0))
                                .getOrigReference() + "]");

            }
        }
View Full Code Here

    Versioner versioner = GenericFileManagerObjectFactory
        .getVersionerFromClassName(product.getProductType().getVersioner());
    try {
      versioner.createDataStoreReferences(product, met);
    } catch (VersioningException e) {
      throw new MetExtractionException(
          "Unable to generate final FileLocation: Reason: " + e.getMessage());
    }

    Reference r = product.getProductReferences().get(0);
    String finalLocation = VersioningUtils.getAbsolutePathFromUri(r
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.metadata.exceptions.MetExtractionException

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.