Package thredds.catalog2.xml.parser

Examples of thredds.catalog2.xml.parser.ThreddsXmlParser


    String baseUriString = "http://cat2.stax.ParseCatalogTest/CatalogWithCompoundService.xml";
    URI docBaseUri = new URI( baseUriString );
    DateType expires = new DateType( false, new Date( System.currentTimeMillis() + 60*60*1000));
    String xml = CatalogXmlUtils.getCatalogWithCompoundService( expires);

    ThreddsXmlParser cp = StaxThreddsXmlParser.newInstance();
    CatalogBuilder catBuilder = cp.parseIntoBuilder( new StringReader( xml ),
                                                     docBaseUri );
    assertNotNull( catBuilder );

    CatalogXmlUtils.assertCatalogWithCompoundServiceAsExpected( catBuilder, docBaseUri, expires);
  }
View Full Code Here


                 ThreddsXmlParserException
  {
    String xml = CatalogXmlUtils.getCatalogWithSingleAccessDatasetWithRawServiceName();
    String baseUriString = "http://cat2.stax.ParseAccessibleDatasetTest/RawServiceName.xml";

    ThreddsXmlParser cp = StaxThreddsXmlParser.newInstance();
    URI docBaseUri = new URI( baseUriString );
    CatalogBuilder catBuilder = cp.parseIntoBuilder( new StringReader( xml ),
                                                     docBaseUri );
    assertNotNull( catBuilder );

    CatalogXmlUtils.assertCatalogHasSingleAccessDataset( catBuilder, docBaseUri );
  }
View Full Code Here

                 ThreddsXmlParserException
  {
    String xml = CatalogXmlUtils.getCatalogWithSingleAccessDatasetWithMetadataServiceName();
    String baseUriString = "http://cat2.stax.ParseAccessibleDatasetTest/MetadataServiceName.xml";

    ThreddsXmlParser cp = StaxThreddsXmlParser.newInstance();
    URI docBaseUri = new URI( baseUriString );
    CatalogBuilder catBuilder = cp.parseIntoBuilder( new StringReader( xml ),
                                                     docBaseUri );
    assertNotNull( catBuilder );

    CatalogXmlUtils.assertCatalogHasSingleAccessDataset( catBuilder, docBaseUri );
  }
View Full Code Here

                 ThreddsXmlParserException
  {
    String xml = CatalogXmlUtils.getCatalogWithSingleAccessDatasetWithInheritedMetadataServiceName();
    String baseUriString = "http://cat2.stax.ParseAccessibleDatasetTest/InheritedMetadataServiceName.xml";

    ThreddsXmlParser cp = StaxThreddsXmlParser.newInstance();
    URI docBaseUri = new URI( baseUriString );
    CatalogBuilder catBuilder = cp.parseIntoBuilder( new StringReader( xml ),
                                                     docBaseUri );
    assertNotNull( catBuilder );

    CatalogXmlUtils.assertCatalogHasSingleAccessDataset( catBuilder, docBaseUri );
  }
View Full Code Here

                 ThreddsXmlParserException
  {
    String xml = CatalogXmlUtils.getCatalogWithSingleAccessDatasetOldStyle();
    String baseUriString = "http://cat2.stax.ParseAccessibleDatasetTest/OldStyleAccess.xml";

    ThreddsXmlParser cp = StaxThreddsXmlParser.newInstance();
    URI docBaseUri = new URI( baseUriString );
    CatalogBuilder catBuilder = cp.parseIntoBuilder( new StringReader( xml ),
                                                     docBaseUri );
    assertNotNull( catBuilder );

    CatalogXmlUtils.assertCatalogHasSingleAccessDataset( catBuilder, docBaseUri );
  }
View Full Code Here

    String xml = CatalogXmlUtils.getNestedDatasetWithRawServiceName();
    String baseUriString = "http://cat2.stax.ParseNestedDatasetTest/RawServiceNameNotAccessible.xml";
      System.out.println( "Catalog ["+baseUriString+"]:\n" + xml );


      ThreddsXmlParser cp = StaxThreddsXmlParser.newInstance();
    URI docBaseUri = new URI( baseUriString );
    CatalogBuilder catBuilder = cp.parseIntoBuilder( new StringReader( xml ),
                                                     docBaseUri );
    assertNotNull( catBuilder );

    CatalogXmlUtils.assertNestedDatasetIsNotAccessible( catBuilder, docBaseUri );
  }
View Full Code Here

                 ThreddsXmlParserException
  {
    String xml = CatalogXmlUtils.getNestedDatasetWithMetadataServiceName();
    String baseUriString = "http://cat2.stax.ParseNestedDatasetTest/MetadataServiceNameNotAccessible.xml";

    ThreddsXmlParser cp = StaxThreddsXmlParser.newInstance();
    URI docBaseUri = new URI( baseUriString );
    CatalogBuilder catBuilder = cp.parseIntoBuilder( new StringReader( xml ),
                                                     docBaseUri );
    assertNotNull( catBuilder );

    CatalogXmlUtils.assertNestedDatasetIsNotAccessible( catBuilder, docBaseUri );
  }
View Full Code Here

                 ThreddsXmlParserException
  {
    String xml = CatalogXmlUtils.getNestedDatasetWithUninheritedMetadataServiceName();
    String baseUriString = "http://cat2.stax.ParseNestedDatasetTest/UninheritedMetadataServiceNameNotAccessible.xml";

    ThreddsXmlParser cp = StaxThreddsXmlParser.newInstance();
    URI docBaseUri = new URI( baseUriString );
    CatalogBuilder catBuilder = cp.parseIntoBuilder( new StringReader( xml ),
                                                     docBaseUri );
    assertNotNull( catBuilder );

    CatalogXmlUtils.assertNestedDatasetIsNotAccessible( catBuilder, docBaseUri );
  }
View Full Code Here

                 ThreddsXmlParserException
  {
    String xml = CatalogXmlUtils.getNestedDatasetWithInheritedMetadataServiceName();
    String baseUriString = "http://cat2.stax.ParseNestedDatasetTest/InheritedMetadataServiceNameNotAccessible.xml";

    ThreddsXmlParser cp = StaxThreddsXmlParser.newInstance();
    URI docBaseUri = new URI( baseUriString );
    CatalogBuilder catBuilder = cp.parseIntoBuilder( new StringReader( xml ),
                                                     docBaseUri );
    assertNotNull( catBuilder );

    CatalogXmlUtils.assertNestedDatasetIsAccessible( catBuilder, docBaseUri );
  }
View Full Code Here

    public static CatalogBuilder parseCatalogIntoBuilder( String docAsString, String docBaseUriString )
            throws URISyntaxException, ThreddsXmlParserException
    {
        URI docBaseUri = new URI( docBaseUriString );

        ThreddsXmlParser cp = StaxThreddsXmlParser.newInstance();
        return cp.parseIntoBuilder( new StringReader( docAsString ), docBaseUri );
    }
View Full Code Here

TOP

Related Classes of thredds.catalog2.xml.parser.ThreddsXmlParser

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.