Package freenet.crypt

Examples of freenet.crypt.MultiHashInputStream$Digester


  }

  private class RuleFactory extends Rule {
    @Override
    public void begin( String namespace, String name, Attributes attributes ) throws Exception {
      Digester digester = getDigester();
      UrlRewriteRulesDescriptor rules = digester.peek();
      UrlRewriteRuleDescriptor rule = rules.newRule();
      getDigester().push( rule );
    }
View Full Code Here


      getDigester().push( rule );
    }

    @Override
    public void end( String namespace, String name ) throws Exception {
      Digester digester = getDigester();
      UrlRewriteRuleDescriptor rule = digester.pop();
      UrlRewriteRulesDescriptor rules = digester.peek();
      rules.addRule( rule );
    }
View Full Code Here

    }
    return topology;
  }

  private static Topology loadTopologyAttempt( File file ) throws IOException, SAXException, URISyntaxException {
    Topology topology;Digester digester = digesterLoader.newDigester();
    TopologyBuilder topologyBuilder = digester.parse( FileUtils.openInputStream( file ) );
    topology = topologyBuilder.build();
    topology.setUri( file.toURI() );
    topology.setName( FilenameUtils.removeExtension( file.getName() ) );
    topology.setTimestamp( file.lastModified() );
    return topology;
View Full Code Here

  public void tearDown() throws Exception {
  }

  @Test
  public void testParseSimpleTopologyXmlInKnoxFormat() throws IOException, SAXException, URISyntaxException {
    Digester digester = loader.newDigester();
    String name = "org/apache/hadoop/gateway/topology/xml/simple-topology-knox-format.xml";
    URL url = ClassLoader.getSystemResource( name );
    assertThat( "Failed to find URL for resource " + name, url, notNullValue() );
    File file = new File( url.getFile() );
    TopologyBuilder topologyBuilder = digester.parse( url );
    Topology topology = topologyBuilder.build();
    assertThat( "Failed to parse resource " + name, topology, notNullValue() );
    topology.setTimestamp( file.lastModified() );

    assertThat( topology.getName(), is( "topology" ) );
View Full Code Here

    assertThat( provider.getParams().size(), is(5));
  }

  @Test
  public void testParseServiceParamsInKnoxFormat() throws IOException, SAXException {
    Digester digester = loader.newDigester();
    String name = "org/apache/hadoop/gateway/topology/xml/service-param-topology-knox-format.xml";
    URL url = ClassLoader.getSystemResource( name );
    assertThat( "Failed to find URL for resource " + name, url, notNullValue() );
    File file = new File( url.getFile() );
    TopologyBuilder topologyBuilder = digester.parse( url );
    Topology topology = topologyBuilder.build();
    assertThat( "Failed to parse resource " + name, topology, notNullValue() );
    topology.setTimestamp( file.lastModified() );

    assertThat( topology.getName(), is( "test-topology-name" ) );
View Full Code Here

  }


  @Test
  public void testParseSimpleTopologyXmlInHadoopFormat() throws IOException, SAXException, URISyntaxException {
    Digester digester = loader.newDigester();
    String name = "org/apache/hadoop/gateway/topology/xml/simple-topology-ambari-format.conf";
    URL url = ClassLoader.getSystemResource( name );
    assertThat( "Failed to find URL for resource " + name, url, notNullValue() );
    File file = new File( url.getFile() );
    TopologyBuilder topologyBuilder = digester.parse( url );
    Topology topology = topologyBuilder.build();
    assertThat( "Failed to parse resource " + name, topology, notNullValue() );
    topology.setTimestamp( file.lastModified() );

    assertThat( topology.getName(), is( "topology2" ) );
View Full Code Here

    assertThat( identityAssertionProvider.getParams().get("name"), is( "user.name" ) );
  }

  @Test
  public void testParseServiceParamsInAmbariFormat() throws IOException, SAXException {
    Digester digester = loader.newDigester();
    String name = "org/apache/hadoop/gateway/topology/xml/service-param-topology-ambari-format.conf";
    URL url = ClassLoader.getSystemResource( name );
    assertThat( "Failed to find URL for resource " + name, url, notNullValue() );
    File file = new File( url.getFile() );
    TopologyBuilder topologyBuilder = digester.parse( url );
    Topology topology = topologyBuilder.build();
    assertThat( "Failed to parse resource " + name, topology, notNullValue() );
    topology.setTimestamp( file.lastModified() );

    assertThat( topology.getName(), is( "test-topology-name" ) );
View Full Code Here

    return "xml";
  }

  @Override
  public UrlRewriteRulesDescriptor load( Reader reader ) throws IOException {
    Digester digester = loader.newDigester( new ExtendedBaseRules() );
    digester.setValidating( false );
    try {
      UrlRewriteRulesDescriptor rules = digester.parse( reader );
      return rules;
    } catch( SAXException e ) {
      throw new IOException( e );
    }
  }
View Full Code Here

  }

  private class RuleFactory extends Rule {
    @Override
    public void begin( String namespace, String name, Attributes attributes ) throws Exception {
      Digester digester = getDigester();
      UrlRewriteRulesDescriptor rules = digester.peek();
      UrlRewriteRuleDescriptor rule = rules.newRule();
      getDigester().push( rule );
    }
View Full Code Here

      getDigester().push( rule );
    }

    @Override
    public void end( String namespace, String name ) throws Exception {
      Digester digester = getDigester();
      UrlRewriteRuleDescriptor rule = digester.pop();
      UrlRewriteRulesDescriptor rules = digester.peek();
      rules.addRule( rule );
    }
View Full Code Here

TOP

Related Classes of freenet.crypt.MultiHashInputStream$Digester

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.