Package org.apache.oodt.cas.filemgr.ingest

Examples of org.apache.oodt.cas.filemgr.ingest.StdIngester


    return resObj.toString();

  }

  private Ingester configureIngester() {
    StdIngester ingest = new StdIngester(DATA_TRANSFER_SERVICE);
    return ingest;
  }
View Full Code Here


   protected abstract File renameProduct(File product, Metadata productMetadata)
         throws Exception;

   @VisibleForTesting void setupIngester() {
      ingester = new StdIngester(getClientTransferer());
   }
View Full Code Here

    }

    private void ingestTestFile() {
        Metadata prodMet = null;
        StdIngester ingester = new StdIngester(transferServiceFacClass);

        try {
            prodMet = new SerializableMetadata(new FileInputStream(
                    "./src/testdata/ingest/test.txt.met"));

            // now add the right file location
            prodMet.addMetadata(CoreMetKeys.FILE_LOCATION, new File(
                    "./src/testdata/ingest").getCanonicalPath());
            ingester.ingest(new URL("http://localhost:" + FM_PORT), new File(
                    "./src/testdata/ingest/test.txt"), prodMet);
        } catch (Exception e) {
            fail(e.getMessage());
        }
    }
View Full Code Here

                "./src/testdata/ingest").getCanonicalPath());
        prodMet.addMetadata(CoreMetKeys.FILENAME, "test.txt");
        prodMet.addMetadata(CoreMetKeys.PRODUCT_NAME, "TestFile");
        prodMet.addMetadata(CoreMetKeys.PRODUCT_TYPE, "GenericFile");
       
        StdIngester ingester = new StdIngester(transferServiceFacClass);
        String productId = ingester.ingest(new URL("http://localhost:" + FM_PORT), new File(
            "./src/testdata/ingest/test.txt"), prodMet);    
        XmlRpcFileManagerClient fmc = new XmlRpcFileManagerClient(new URL(
                "http://localhost:" + FM_PORT));
        Metadata m = fmc.getMetadata(fmc.getProductById(productId));
        assertEquals(m.getMetadata("Filename"), "test.txt");
View Full Code Here

        assertEquals(m.getMetadata("Filename"), "test.txt");
        deleteAllFiles("/tmp/test-type");
    }
   
    public void testComplexQuery() throws Exception {
        StdIngester ingester = new StdIngester(transferServiceFacClass);

        //ingest first file
        Metadata prodMet = new Metadata();
        prodMet.addMetadata(CoreMetKeys.FILE_LOCATION, new File(
                "./src/testdata/ingest").getCanonicalPath());
        prodMet.addMetadata(CoreMetKeys.FILENAME, "test-file-1.txt");
        prodMet.addMetadata(CoreMetKeys.PRODUCT_NAME, "TestFile1");
        prodMet.addMetadata(CoreMetKeys.PRODUCT_TYPE, "GenericFile");
        ingester.ingest(new URL("http://localhost:" + FM_PORT), new File(
            "./src/testdata/ingest/test-file-1.txt"), prodMet);          
       
        //ingest second file
        prodMet.replaceMetadata(CoreMetKeys.FILENAME, "test-file-2.txt");
        prodMet.replaceMetadata(CoreMetKeys.PRODUCT_NAME, "TestFile2");
        ingester.ingest(new URL("http://localhost:" + FM_PORT), new File(
            "./src/testdata/ingest/test-file-2.txt"), prodMet);  
       
        //perform complex query
        ComplexQuery complexQuery = new ComplexQuery();
        List<String> reducedMetadata = new Vector<String>();
View Full Code Here

    }

    private void ingestTestFile() {
        Metadata prodMet = null;
        StdIngester ingester = new StdIngester(transferServiceFacClass);

        try {
            prodMet = new SerializableMetadata(new FileInputStream(
                    "./src/testdata/ingest/test.txt.met"));

            // now add the right file location
            prodMet.addMetadata(CoreMetKeys.FILE_LOCATION, new File(
                    "./src/testdata/ingest").getCanonicalPath());
            prodMet.addMetadata(CoreMetKeys.FILENAME, "test.txt");
            prodMet.addMetadata(CoreMetKeys.PRODUCT_TYPE, "GenericFile");
            ingester.ingest(new URL("http://localhost:" + FM_PORT), new File(
                    "./src/testdata/ingest/test.txt"), prodMet);
        } catch (Exception e) {
            fail(e.getMessage());
        }
    }
View Full Code Here

  }

  private void ingestTestFile() {
    Metadata prodMet = null;
    StdIngester ingester = new StdIngester(transferServiceFacClass);

    try {
      prodMet = new SerializableMetadata(new FileInputStream(
          "./src/testdata/ingest/test.txt.met"));

      // now add the right file location
      prodMet.addMetadata(CoreMetKeys.FILE_LOCATION, new File(
          "./src/testdata/ingest").getCanonicalPath());
      prodMet.addMetadata(CoreMetKeys.FILENAME, "test.txt");
      prodMet.addMetadata(CoreMetKeys.PRODUCT_TYPE, "GenericFile");
      ingester.ingest(new URL("http://localhost:" + FM_PORT), new File(
          "./src/testdata/ingest/test.txt"), prodMet);
    } catch (Exception e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

        deleteAllFiles("/tmp/test.txt");
    }

    private void ingestTestFiles() {
        Metadata prodMet = null;
        StdIngester ingester = new StdIngester(transferServiceFacClass);

        try {
            prodMet = new SerializableMetadata(new FileInputStream(
                    "./src/testdata/ingest/test.txt.met"));

            // now add the right file location
            prodMet.addMetadata(CoreMetKeys.FILE_LOCATION, new File(
                    "./src/testdata/ingest").getCanonicalPath());
            ingester.ingest(new URL("http://localhost:" + FM_PORT), new File(
                    "./src/testdata/ingest/test.txt"), prodMet);
           
            prodMet.replaceMetadata(CoreMetKeys.PRODUCT_NAME, "TestTypeFile");
            prodMet.replaceMetadata(CoreMetKeys.PRODUCT_TYPE, "TestType");
            ingester.ingest(new URL("http://localhost:" + FM_PORT), new File(
                "./src/testdata/ingest/test.txt"), prodMet);
        } catch (Exception e) {
            fail(e.getMessage());
        }
    }
View Full Code Here

            (this.actionRepo = new CrawlerActionRepo())
                    .loadActionsFromBeanFactory(this.getApplicationContext(), this
                            .getActionIds());

        // create ingester
        this.ingester = new StdIngester(this.getClientTransferer());

        if (dirRoot == null || ((dirRoot != null && !dirRoot.exists())))
            throw new IllegalArgumentException("dir root is null or non existant!");

        // start crawling
View Full Code Here

   protected abstract File renameProduct(File product, Metadata productMetadata)
         throws Exception;

   @VisibleForTesting void setupIngester() {
      ingester = new StdIngester(getClientTransferer());
   }
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.filemgr.ingest.StdIngester

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.