Package org.apache.oodt.cas.metadata

Examples of org.apache.oodt.cas.metadata.Metadata.replaceMetadata()


}

  protected File renameFile(File file, PathUtilsNamingConvention renamingConv)
      throws Exception {
    Metadata curMetadata = this.pgeMetadata.asMetadata();
    curMetadata.replaceMetadata(renamingConv.getTmpReplaceMet());
    return renamingConv.rename(file, curMetadata);
  }

  protected Metadata getMetadataForFile(File sciPgeCreatedDataFile,
      PcsMetFileWriter writer, Object[] args) throws Exception {
View Full Code Here


   }

   public void testContainsRequiredMetadata() {
      ProductCrawler pc = createDummyCrawler();
      Metadata m = new Metadata();
      m.replaceMetadata(CoreMetKeys.PRODUCT_TYPE, "GenericFile");
      m.replaceMetadata(CoreMetKeys.FILENAME, "TestFile.txt");
      m.replaceMetadata(CoreMetKeys.FILE_LOCATION, "/tmp/dir");
      m.replaceMetadata(CoreMetKeys.FILE_SIZE, "0");
      assertTrue(pc.containsRequiredMetadata(m));
      assertFalse(pc.containsRequiredMetadata(new Metadata()));
View Full Code Here

   public void testContainsRequiredMetadata() {
      ProductCrawler pc = createDummyCrawler();
      Metadata m = new Metadata();
      m.replaceMetadata(CoreMetKeys.PRODUCT_TYPE, "GenericFile");
      m.replaceMetadata(CoreMetKeys.FILENAME, "TestFile.txt");
      m.replaceMetadata(CoreMetKeys.FILE_LOCATION, "/tmp/dir");
      m.replaceMetadata(CoreMetKeys.FILE_SIZE, "0");
      assertTrue(pc.containsRequiredMetadata(m));
      assertFalse(pc.containsRequiredMetadata(new Metadata()));
   }
View Full Code Here

   public void testContainsRequiredMetadata() {
      ProductCrawler pc = createDummyCrawler();
      Metadata m = new Metadata();
      m.replaceMetadata(CoreMetKeys.PRODUCT_TYPE, "GenericFile");
      m.replaceMetadata(CoreMetKeys.FILENAME, "TestFile.txt");
      m.replaceMetadata(CoreMetKeys.FILE_LOCATION, "/tmp/dir");
      m.replaceMetadata(CoreMetKeys.FILE_SIZE, "0");
      assertTrue(pc.containsRequiredMetadata(m));
      assertFalse(pc.containsRequiredMetadata(new Metadata()));
   }
View Full Code Here

      ProductCrawler pc = createDummyCrawler();
      Metadata m = new Metadata();
      m.replaceMetadata(CoreMetKeys.PRODUCT_TYPE, "GenericFile");
      m.replaceMetadata(CoreMetKeys.FILENAME, "TestFile.txt");
      m.replaceMetadata(CoreMetKeys.FILE_LOCATION, "/tmp/dir");
      m.replaceMetadata(CoreMetKeys.FILE_SIZE, "0");
      assertTrue(pc.containsRequiredMetadata(m));
      assertFalse(pc.containsRequiredMetadata(new Metadata()));
   }

   public void testAddKnowMetadata() {
View Full Code Here

  }

    private Metadata buildProductMetadata(Product product, Metadata metadata)
      throws CatalogException {
    Metadata pMet = new Metadata();
    pMet.replaceMetadata(ProductMetKeys.PRODUCT_ID, product.getProductId() != null ?
        product.getProductId():"unknown");
    pMet.replaceMetadata(ProductMetKeys.PRODUCT_NAME, product.getProductName() != null ?
        product.getProductName():"unknown");
    pMet.replaceMetadata(ProductMetKeys.PRODUCT_STRUCTURE, product
        .getProductStructure() != null ? product.getProductStructure():"unknown");
View Full Code Here

    private Metadata buildProductMetadata(Product product, Metadata metadata)
      throws CatalogException {
    Metadata pMet = new Metadata();
    pMet.replaceMetadata(ProductMetKeys.PRODUCT_ID, product.getProductId() != null ?
        product.getProductId():"unknown");
    pMet.replaceMetadata(ProductMetKeys.PRODUCT_NAME, product.getProductName() != null ?
        product.getProductName():"unknown");
    pMet.replaceMetadata(ProductMetKeys.PRODUCT_STRUCTURE, product
        .getProductStructure() != null ? product.getProductStructure():"unknown");
    pMet.replaceMetadata(ProductMetKeys.PRODUCT_TRANSFER_STATUS, product
        .getTransferStatus() != null ? product.getTransferStatus():"unknown");
View Full Code Here

    Metadata pMet = new Metadata();
    pMet.replaceMetadata(ProductMetKeys.PRODUCT_ID, product.getProductId() != null ?
        product.getProductId():"unknown");
    pMet.replaceMetadata(ProductMetKeys.PRODUCT_NAME, product.getProductName() != null ?
        product.getProductName():"unknown");
    pMet.replaceMetadata(ProductMetKeys.PRODUCT_STRUCTURE, product
        .getProductStructure() != null ? product.getProductStructure():"unknown");
    pMet.replaceMetadata(ProductMetKeys.PRODUCT_TRANSFER_STATUS, product
        .getTransferStatus() != null ? product.getTransferStatus():"unknown");
    pMet.replaceMetadata(ProductMetKeys.PRODUCT_ROOT_REFERENCE, product.getRootRef() != null ?
        VersioningUtils
View Full Code Here

        product.getProductId():"unknown");
    pMet.replaceMetadata(ProductMetKeys.PRODUCT_NAME, product.getProductName() != null ?
        product.getProductName():"unknown");
    pMet.replaceMetadata(ProductMetKeys.PRODUCT_STRUCTURE, product
        .getProductStructure() != null ? product.getProductStructure():"unknown");
    pMet.replaceMetadata(ProductMetKeys.PRODUCT_TRANSFER_STATUS, product
        .getTransferStatus() != null ? product.getTransferStatus():"unknown");
    pMet.replaceMetadata(ProductMetKeys.PRODUCT_ROOT_REFERENCE, product.getRootRef() != null ?
        VersioningUtils
        .getAbsolutePathFromUri(product.getRootRef().getDataStoreReference()):"unknown");
View Full Code Here

        product.getProductName():"unknown");
    pMet.replaceMetadata(ProductMetKeys.PRODUCT_STRUCTURE, product
        .getProductStructure() != null ? product.getProductStructure():"unknown");
    pMet.replaceMetadata(ProductMetKeys.PRODUCT_TRANSFER_STATUS, product
        .getTransferStatus() != null ? product.getTransferStatus():"unknown");
    pMet.replaceMetadata(ProductMetKeys.PRODUCT_ROOT_REFERENCE, product.getRootRef() != null ?
        VersioningUtils
        .getAbsolutePathFromUri(product.getRootRef().getDataStoreReference()):"unknown");

    List<Reference> refs = product.getProductReferences();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.