Package thredds.crawlabledataset

Examples of thredds.crawlabledataset.CrawlableDatasetFilter



    File catWriteDir = new File( tmpDir, "catWriteDir");
    CrawlableDataset collectionCrDs = new CrawlableDatasetFile( tmpDir );
    InvService service = new InvService( "myServer", "File", collectionCrDs.getPath() + "/", null, null );
    CrawlableDatasetFilter filter = null;
    CrawlableDataset topCatCrDs = collectionCrDs.getDescendant( startPath );

    CatGenAndWrite cgaw = null;
    try
    {
View Full Code Here


    File catWriteDir = new File( tmpDir, "catWriteDir" );
    CrawlableDataset collectionCrDs = new CrawlableDatasetFile( tmpDir );

    InvService service = new InvService( "myServer", "OPeNDAP", "/thredds/dodsC/", null, null );
    CrawlableDatasetFilter filter = null;
    CrawlableDataset topCatCrDs = collectionCrDs.getDescendant( startPath );

    CatGenAndWrite cgaw = null;
    try
    {
View Full Code Here

  }
  public InvCatalog getDirCatalog( CrawlableDataset catalogCrDs, String filterPattern, boolean sortInIncreasingOrder, String addIdBase, boolean addDatasetSize, String dsNameMatchPattern, String startTimeSubstitutionPattern, String duration )
  {

    // Setup the filter
    CrawlableDatasetFilter filter = null;
    if ( filterPattern != null )
    {
      // Include atomic datasets that match the given filter string.
      MultiSelectorFilter.Selector selector = new MultiSelectorFilter.Selector( new RegExpMatchOnNameFilter( filterPattern), true, true, false );
      filter = new MultiSelectorFilter( selector );
View Full Code Here

    File catWriteDir = new File( catWriteDirPath );

    File collectionFile = new File( collectionPath );
    CrawlableDataset collectionCrDs = new CrawlableDatasetFile( collectionFile );
    InvService service = new InvService( "myServer", "File", collectionCrDs.getPath() + "/", null, null);
    CrawlableDatasetFilter filter = null;
    CrawlableDataset topCatCrDs = collectionCrDs.getDescendant( startPath );

    CatGenAndWrite cgaw = new CatGenAndWrite( "DATA", "My data", "", service,
                                              collectionCrDs, topCatCrDs, filter, null, catWriteDir );
View Full Code Here

    File catWriteDir = new File( catWriteDirPath );

    File collectionFile = new File( collectionPath );
    CrawlableDataset collectionCrDs = new CrawlableDatasetFile( collectionFile );
    InvService service = new InvService( "myServer", "OPENDAP", "/thredds/dodsC/", null, null );
    CrawlableDatasetFilter filter = null;
    CrawlableDataset topCatCrDs = collectionCrDs.getDescendant( startPath );

    CatGenAndWrite cgaw = new CatGenAndWrite( "DATA", "My data", "mlode", service,
                                              collectionCrDs, topCatCrDs, filter, null, catWriteDir );
View Full Code Here

    }
    Element inFilterElem = inDoc.getRootElement();

    InvCatalogFactory fac = InvCatalogFactory.getDefaultFactory( false);
    InvCatalogFactory10 factory = (InvCatalogFactory10) fac.getCatalogConverter( thredds.catalog.XMLEntityResolver.CATALOG_NAMESPACE_10 );
    CrawlableDatasetFilter inFilter = factory.readDatasetScanFilter( inFilterElem);
    Element outFilterElem = factory.writeDatasetScanFilter( inFilter );

    // Write the resulting element to string.
    ByteArrayOutputStream inBaos = new ByteArrayOutputStream();
    ByteArrayOutputStream outBaos = new ByteArrayOutputStream();
View Full Code Here

            <filter lastModifiedLimit="60000"/>
          </filter>
        </filter>
      </filter>
     */
    CrawlableDatasetFilter includeGribFilter =
            new MultiSelectorFilter( new MultiSelectorFilter.Selector( new WildcardMatchOnNameFilter( "*.grib1"), true, true, false ) );
    CrawlableDatasetFilter lastModAtLeast4MinPastFilter = new LastModifiedLimitFilter( 240000 );
    CrawlableDatasetFilter oldGribFilter =
            LogicalFilterComposer.getAndFilter( includeGribFilter, lastModAtLeast4MinPastFilter);

    CrawlableDatasetFilter includeNcFilter =
            new MultiSelectorFilter( new MultiSelectorFilter.Selector( new WildcardMatchOnNameFilter( "*.nc"), true, true, false ) );
    CrawlableDatasetFilter newNcFilter =
            LogicalFilterComposer.getAndFilter( includeNcFilter,
            LogicalFilterComposer.getNotFilter( lastModAtLeast4MinPastFilter ) );

    CrawlableDatasetFilter oldGribOrNewNcFilter = LogicalFilterComposer.getOrFilter( oldGribFilter, newNcFilter);

    CrawlableDataset tmpDirCrDs = new CrawlableDatasetFile( tmpDir);
    List crDsList = null;
    try
    {
      crDsList = tmpDirCrDs.listDatasets();
    }
    catch ( IOException e )
    {
      assertTrue( "I/O problem getting contained dataset list.",
                  false );
      deleteFiles();
      return;
    }
    for ( Iterator it = crDsList.iterator(); it.hasNext(); )
    {
      CrawlableDataset curCrDs = (CrawlableDataset) it.next();
      if ( oldGribOrNewNcFilter.accept( curCrDs) )
      {
        if ( ! curCrDs.getName().equals( "old.grib1")
             && ! curCrDs.getName().equals( "new.nc"))
        {
          assertTrue( "Matched wrong file <" + curCrDs.getPath() + ">.",
View Full Code Here

TOP

Related Classes of thredds.crawlabledataset.CrawlableDatasetFilter

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.