Package org.apache.oodt.cas.filemgr.structs

Examples of org.apache.oodt.cas.filemgr.structs.Reference


        .getDefaultFlatProduct("testdir", "urn:oodt:GenericFile");
    p.setProductStructure(Product.STRUCTURE_HIERARCHICAL);
    p.getProductType().setProductRepositoryPath("file:///archive");

    p.getProductReferences().add(
        new Reference("file:///tmp/somedir/", null, 4L));
    p.getProductReferences().add(
        new Reference("file:///tmp/somedir/file.txt", null, 4096L));

    BasicVersioner versioner = new BasicVersioner();
    try {
      versioner.createDataStoreReferences(p, new Metadata());
    } catch (Exception e) {
View Full Code Here


  public void testVersionerWithNoStartDateTimeAndNoAcqDate() {
    AcquisitionDateVersioner versioner = new AcquisitionDateVersioner();
    Product p = Product.getDefaultFlatProduct("test", "urn:oodt:GenericFile");
    p.getProductType().setProductRepositoryPath("file:///home/files");
    Reference r = new Reference("file:///tmp/dir1/file1.txt", null, 4L);
    p.getProductReferences().add(r);
    Metadata met = new Metadata();
    met.addMetadata(CoreMetKeys.FILENAME, "file1.txt");
    SimpleDateFormat acqDateFormatter = new SimpleDateFormat(
        AcquisitionDateVersioner.ACQ_DATE_FORMAT);
View Full Code Here

  public void testVersionerWithNoStartDateTimeAndAcqDate() {
    AcquisitionDateVersioner versioner = new AcquisitionDateVersioner();
    Product p = Product.getDefaultFlatProduct("test", "urn:oodt:GenericFile");
    p.getProductType().setProductRepositoryPath("file:///home/files");
    Reference r = new Reference("file:///tmp/dir1/file1.txt", null, 4L);
    p.getProductReferences().add(r);
    Metadata met = new Metadata();
    met.addMetadata(CoreMetKeys.FILENAME, "file1.txt");
    met.addMetadata("AcquisitionDate", "090910");
    String expectedPath = "file:/home/files/"
View Full Code Here

  public void testVersionerWithStartDateTime() {
    AcquisitionDateVersioner versioner = new AcquisitionDateVersioner();
    Product p = Product.getDefaultFlatProduct("test", "urn:oodt:GenericFile");
    p.getProductType().setProductRepositoryPath("file:///home/files");
    Reference r = new Reference("file:///tmp/dir1/file1.txt", null, 4L);
    p.getProductReferences().add(r);
    Metadata met = new Metadata();
    met.addMetadata(CoreMetKeys.FILENAME, "file1.txt");
    met.addMetadata("StartDateTime", "2006-09-10T00:00:01.000Z");
    String expectedPath = "file:/home/files/060910/file1.txt";
View Full Code Here

   private Product createDummyProduct() {
      Product testProduct = Product.getDefaultFlatProduct("test",
            "urn:oodt:GenericFile");
      testProduct.getProductReferences().add(
            new Reference(origFile.toURI().toString(), new File(repoDir,
                  "test.txt").toURI().toString(), origFile.length()));
      return testProduct;
   }
View Full Code Here

    Metadata metadata = new Metadata();
    metadata.addMetadata("ProductType", "FooFile");
    metadata.addMetadata("ProductionDate", "060804");
    metadata.addMetadata("Filename", "foo.txt");

    Reference r = new Reference();
    product.getProductReferences().add(r);

    MetadataBasedFileVersioner versioner = new MetadataBasedFileVersioner(
        filePathSpec);
    try {
      versioner.createDataStoreReferences(product, metadata);
    } catch (VersioningException e) {
      fail(e.getMessage());
    }

    String expected = "file:/foo/bar/FooFile/060804/foo.txt";
    assertEquals("The reference: [" + r.getDataStoreReference()
        + "] is not equal to: [" + expected + "]", expected, r
        .getDataStoreReference());
  }
View Full Code Here

       assertEquals(product, roundTripProduct);

       product = new Product();
       product.setProductId("TestId");
       product.setProductName("TestName");
       product.setProductReferences(Lists.newArrayList(new Reference("file:///original/path", null, 2)));
       product.setProductStructure("Flat");
       product.setProductType(fmClient.getProductTypeByName("GenericFile"));
       product.setRootRef(new Reference("file:///original/root", "file:///datastore/root", 3));
       roundTripProduct = XmlRpcStructFactory.getProductFromXmlRpc(XmlRpcStructFactory.getXmlRpcProduct(product));
       assertEquals(product, roundTripProduct);
       Metadata m = new Metadata();
       m.addMetadata("TestKey", "TestValue");
      
View Full Code Here

    Metadata metadata = new Metadata();
    metadata.addMetadata("ProductType", "FooFile");
    metadata.addMetadata("ProductionDate", "060804");
    metadata.addMetadata("Filename", "foo.txt");

    Reference r = new Reference();
    product.getProductReferences().add(r);

    MetadataBasedFileVersioner versioner = new MetadataBasedFileVersioner(
        filePathSpec);
    try {
      versioner.createDataStoreReferences(product, metadata);
    } catch (VersioningException e) {
      fail(e.getMessage());
    }

    String expected = "file:/foo/bar/FooFile/some/other/path060804/foo.txt";
    assertEquals("The reference: [" + r.getDataStoreReference()
        + "] is not equal to: [" + expected + "]", expected, r
        .getDataStoreReference());
  }
View Full Code Here

    product.setProductStructure(Product.STRUCTURE_FLAT);
    ProductType pt = new ProductType();
    pt.setProductRepositoryPath("file:/base/path");
    pt.setName("TEST_TYPE");
    product.setProductType(pt);
    Reference ref = new Reference();
    ref.setOrigReference("/path/to/file");
    product.setProductReferences(Lists.newArrayList(ref));
  }
View Full Code Here

         URISyntaxException {
      String productId = "12345";

      String uri1 = "file:///path/to/file1";
      String uri2 = "file:///path/to/file2";
      Reference ref1 = new Reference();
      ref1.setDataStoreReference(uri1);
      Reference ref2 = new Reference();
      ref2.setDataStoreReference(uri2);

      XmlRpcFileManagerClient fmClient = createStrictMock(XmlRpcFileManagerClient.class);
      expect(fmClient.getProductReferences(ProductIdMatcher.eqProductId(productId))).andReturn(
            Lists.newArrayList(ref1, ref2));
      replay(fmClient);
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.filemgr.structs.Reference

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.