Package org.apache.oodt.cas.metadata

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


    }

    public void testAddMetadata() {
        Metadata met = new Metadata();
        met.addMetadata("ProductStructure", Product.STRUCTURE_FLAT);

        Product testProduct = getTestProduct();
        try {
            myCat.addProduct(testProduct);
            myCat.addMetadata(met, testProduct);
View Full Code Here


    }

    public void testRemoveMetadata() {
        Metadata met = new Metadata();
        met.addMetadata("Filename", "tempProduct");
        met.addMetadata("ProductStructure", "Flat");

        Product testProduct = getTestProduct();
        try {
            myCat.addProduct(testProduct);
View Full Code Here

    }

    public void testRemoveMetadata() {
        Metadata met = new Metadata();
        met.addMetadata("Filename", "tempProduct");
        met.addMetadata("ProductStructure", "Flat");

        Product testProduct = getTestProduct();
        try {
            myCat.addProduct(testProduct);
            myCat.addMetadata(met, testProduct);
View Full Code Here

        Reference ref = new Reference("file:///foo.txt", "file:///bar.txt", 100);
            Vector<Reference> references = new Vector<Reference>();
            references.add(ref);
            testProduct.setProductReferences(references);
        Metadata met = new Metadata();
        met.addMetadata("Filename", "tempProduct" + i);
        met.addMetadata("ProductStructure", "Flat");
        try {
                myCat.addProduct(testProduct);
                myCat.addMetadata(met, testProduct);
            } catch (Exception e) {
View Full Code Here

            Vector<Reference> references = new Vector<Reference>();
            references.add(ref);
            testProduct.setProductReferences(references);
        Metadata met = new Metadata();
        met.addMetadata("Filename", "tempProduct" + i);
        met.addMetadata("ProductStructure", "Flat");
        try {
                myCat.addProduct(testProduct);
                myCat.addMetadata(met, testProduct);
            } catch (Exception e) {
                e.printStackTrace();
View Full Code Here

        return testProduct;
    }

    private static Metadata getTestMetadata(String prodName) {
        Metadata met = new Metadata();
        met.addMetadata("CAS.ProductName", prodName);
        return met;
    }

}
View Full Code Here

    Reference r = new Reference("file:///tmp/dir1", null, 4L);
    Reference r2 = new Reference("file:///tmp/dir1/file1.txt", null, 20L);
    p.getProductReferences().add(r);
    p.getProductReferences().add(r2);
    Metadata met = new Metadata();
    met.addMetadata(CoreMetKeys.FILENAME, "dir1");
    try {
      versioner.createDataStoreReferences(p, met);
    } catch (Exception e) {
      e.printStackTrace();
      fail(e.getMessage());
View Full Code Here

    type.setProductRepositoryPath(productRepoPath);
    product.setProductStructure(Product.STRUCTURE_FLAT);
    product.setProductType(type);
   
    Metadata metadata = new Metadata();
    metadata.addMetadata(SingleFileBasicVersioner.FILENAME_FIELD, "testfile.txt");
   
    Reference r = new Reference();
    r.setOrigReference(origFileRef);
   
    product.getProductReferences().add(r);
View Full Code Here

      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());
      prodMet.addMetadata(CoreMetKeys.FILENAME, "test.txt");
      prodMet.addMetadata(CoreMetKeys.PRODUCT_TYPE, "GenericFile");
      ingester.ingest(new URL("http://localhost:" + FM_PORT), new File(
        refUrl.getFile()), prodMet);
View Full Code Here

        new File(metUrl.getFile())));

      // now add the right file location
      prodMet.addMetadata(CoreMetKeys.FILE_LOCATION, new File(
        ingestUrl.getFile()).getCanonicalPath());
      prodMet.addMetadata(CoreMetKeys.FILENAME, "test.txt");
      prodMet.addMetadata(CoreMetKeys.PRODUCT_TYPE, "GenericFile");
      ingester.ingest(new URL("http://localhost:" + FM_PORT), new File(
        refUrl.getFile()), prodMet);
    } catch (Exception e) {
      fail(e.getMessage());
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.