Package org.apache.oodt.cas.metadata

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


      // 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


    product.setProductStructure(Product.STRUCTURE_FLAT);
    product.setProductType(type);

      Date prodDateTime = new Date();
    String prodDateTimeStr = DateConvert.isoFormat(prodDateTime);
    metadata.addMetadata("CAS.ProductReceivedTime", prodDateTimeStr);
   

        SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyyddMM.HHmmss");
        String prodDateTimeNonIso = dateFormatter.format(prodDateTime);
View Full Code Here

        System.setProperties(properties);
    }
  
    public void testAddAndGetMetadata() throws SQLException, MalformedURLException, ConnectionException {
        Metadata met = new Metadata();
        met.addMetadata("DataVersion", "4.0");
        met.addMetadata("ProductName", "test");
        Product testProduct = getTestProduct();

        XmlRpcFileManagerClient fmClient = new XmlRpcFileManagerClient(new URL("http://localhost:" + FILEMGR_PORT));
        try {
View Full Code Here

    }
  
    public void testAddAndGetMetadata() throws SQLException, MalformedURLException, ConnectionException {
        Metadata met = new Metadata();
        met.addMetadata("DataVersion", "4.0");
        met.addMetadata("ProductName", "test");
        Product testProduct = getTestProduct();

        XmlRpcFileManagerClient fmClient = new XmlRpcFileManagerClient(new URL("http://localhost:" + FILEMGR_PORT));
        try {
            testProduct.setProductType(fmClient.getProductTypeByName("GenericFile"));
View Full Code Here

  private static final String expected = "file:/data/archive/130622/somefile.txt";

  public void testVersion() {
    Metadata met = new Metadata();
    met.addMetadata("Filename", "somefile.txt");
    met.addMetadata("AcquisitionDate", "130622");
    Product prod = Product.getDefaultFlatProduct("foo", "urn:sometype:foo");
    prod.getProductType().setProductRepositoryPath("file:///data/archive");
    prod.getProductType().getTypeMetadata()
        .addMetadata("filePathSpec", "/[AcquisitionDate]/[Filename]");
View Full Code Here

  private static final String expected = "file:/data/archive/130622/somefile.txt";

  public void testVersion() {
    Metadata met = new Metadata();
    met.addMetadata("Filename", "somefile.txt");
    met.addMetadata("AcquisitionDate", "130622");
    Product prod = Product.getDefaultFlatProduct("foo", "urn:sometype:foo");
    prod.getProductType().setProductRepositoryPath("file:///data/archive");
    prod.getProductType().getTypeMetadata()
        .addMetadata("filePathSpec", "/[AcquisitionDate]/[Filename]");
    prod.getProductReferences().add(
View Full Code Here

        assertEquals(rs.getString("metadata_value"), "04.00");
    }
   
    public void testQuery() throws MalformedURLException, ConnectionException, CatalogException {
        Metadata met = new Metadata();
        met.addMetadata("DataVersion", "4.0");
        met.addMetadata("ProductName", "test");
        Product testProduct = getTestProduct();

        ProductType genericFile = null;
        XmlRpcFileManagerClient fmClient = new XmlRpcFileManagerClient(new URL("http://localhost:" + FILEMGR_PORT));
View Full Code Here

    }
   
    public void testQuery() throws MalformedURLException, ConnectionException, CatalogException {
        Metadata met = new Metadata();
        met.addMetadata("DataVersion", "4.0");
        met.addMetadata("ProductName", "test");
        Product testProduct = getTestProduct();

        ProductType genericFile = null;
        XmlRpcFileManagerClient fmClient = new XmlRpcFileManagerClient(new URL("http://localhost:" + FILEMGR_PORT));
        try {
View Full Code Here

        assertEquals(products.get(0).getProductId(), testProduct.getProductId());
    }
   
    public void testGetCatalogAndOrigValuesAndGetCatalogQuery() throws ConnectionException, RepositoryManagerException, XmlRpcException, IOException {
        Metadata met = new Metadata();
        met.addMetadata("DataVersion", "4.0");
        met.addMetadata("ProductName", "test");
        Product testProduct = getTestProduct();

        XmlRpcFileManagerClient fmClient = new XmlRpcFileManagerClient(new URL("http://localhost:" + FILEMGR_PORT));
        ProductType genericFile = fmClient.getProductTypeByName("GenericFile");
View Full Code Here

    }
   
    public void testGetCatalogAndOrigValuesAndGetCatalogQuery() throws ConnectionException, RepositoryManagerException, XmlRpcException, IOException {
        Metadata met = new Metadata();
        met.addMetadata("DataVersion", "4.0");
        met.addMetadata("ProductName", "test");
        Product testProduct = getTestProduct();

        XmlRpcFileManagerClient fmClient = new XmlRpcFileManagerClient(new URL("http://localhost:" + FILEMGR_PORT));
        ProductType genericFile = fmClient.getProductTypeByName("GenericFile");
        assertEquals("04.00", (met = fmClient.getCatalogValues(met, genericFile)).getMetadata("DataVersion"));
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.