当前位置: 首页>>代码示例>>Java>>正文


Java AssetsBundle类代码示例

本文整理汇总了Java中io.dropwizard.assets.AssetsBundle的典型用法代码示例。如果您正苦于以下问题:Java AssetsBundle类的具体用法?Java AssetsBundle怎么用?Java AssetsBundle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AssetsBundle类属于io.dropwizard.assets包,在下文中一共展示了AssetsBundle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initialize

import io.dropwizard.assets.AssetsBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<SECPConfiguration> bootstrap) {
    bootstrap.addBundle(new AssetsBundle("/assets/app/", "/", "index.html"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/login", "index.html", "login"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/login/authenticate", "index.html", "authenticate"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/login/forgot-password", "index.html", "forgot-password"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/chats", "index.html", "chats"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/portal", "index.html", "portal"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/portal/user-profile", "index.html", "user-profile"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/portal/user-profile/change-password", "index.html", "change-password"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/portal/group-profile", "index.html", "group-profile"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/portal/audit", "index.html", "audit"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/portal/audit/user", "index.html", "audit-user"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/portal/audit/group", "index.html", "audit-group"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/portal/manage", "index.html", "manage"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/portal/manage/user", "index.html", "manage-user"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/portal/manage/group", "index.html", "manage-group"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/portal/configure", "index.html", "configure"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/portal/configure/filter", "index.html", "tags"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/portal/configure/tags", "index.html", "filter"));
    bootstrap.addBundle(new AssetsBundle("/assets/app", "/error/404", "index.html", "404"));

    bootstrap.addBundle(hibernateBundle);
    ObjectMapper mapper = bootstrap.getObjectMapper();
    mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
}
 
开发者ID:tosinoni,项目名称:SECP,代码行数:27,代码来源:SECPService.java

示例2: initialize

import io.dropwizard.assets.AssetsBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<ServerConfiguration> bootstrap) {
    bootstrap.addBundle(hibernateBundle);

    bootstrap.addBundle(new AssetsBundle("/swagger-spec", "/api-spec", null));

    bootstrap.addBundle(GuiceBundle.<ServerConfiguration>newBuilder()
        .addModule(new AbstractModule(){
            @Override protected void configure() {}
            @Provides SessionFactory sessionFactoryProvider() { return hibernateBundle.getSessionFactory();}
        })
        .setConfigClass(ServerConfiguration.class)
        .enableAutoConfig(getClass().getPackage().getName())
        .build(Stage.DEVELOPMENT)
    );

    bootstrap.addBundle(new Java8Bundle());

    // Enable variable substitution with environment variables
    bootstrap.setConfigurationSourceProvider(
        new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
            new EnvironmentVariableSubstitutor(false)
        )
    );
}
 
开发者ID:gov-ithub,项目名称:StopCozi-api,代码行数:26,代码来源:Server.java

示例3: initialize

import io.dropwizard.assets.AssetsBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<RegisterConfiguration> bootstrap) {
    bootstrap.addBundle(new ViewBundle<>(ImmutableList.of(new ThymeleafViewRenderer("HTML5", "/templates/", ".html", false))));

    if (isRunningOnCloudFoundry()) {
        bootstrap.setConfigurationSourceProvider(new UrlConfigurationSourceProvider());
    }

    bootstrap.setConfigurationSourceProvider(
            new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
                    new EnvironmentVariableSubstitutor(false)
            ));
    bootstrap.addBundle(new AssetsBundle("/assets"));
    bootstrap.addBundle(new CorsBundle());
    bootstrap.addBundle(new LogstashBundle());

    System.setProperty("java.protocol.handler.pkgs", "uk.gov.register.protocols");
}
 
开发者ID:openregister,项目名称:openregister-java,代码行数:19,代码来源:RegisterApplication.java

示例4: initialize

import io.dropwizard.assets.AssetsBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<SamConfiguration> bootstrap) {

  final List<ViewRenderer> renderers = Arrays.asList(new MarkdownViewRenderer(), new HtmlViewRenderer(), new MustacheViewRenderer());
  bootstrap.addBundle(new ViewBundle<SamConfiguration>(renderers));
  bootstrap.addBundle(new AssetsBundle("/static", "/static", "index.mustache", "static"));
  bootstrap.addBundle(new AssetsBundle("/docs", "/docs", "index.html", "docs"));

  bootstrap.setConfigurationSourceProvider(
    new SubstitutingSourceProvider(
      bootstrap.getConfigurationSourceProvider(),
      new EnvironmentVariableSubstitutor()
    )
  );

  bootstrap.addCommand(new OAuth2Command());
  bootstrap.addCommand(new CreateDatabaseCommand(this));
  bootstrap.addCommand(new AddTestdataCommand(this));
}
 
开发者ID:atgse,项目名称:sam,代码行数:20,代码来源:Main.java

示例5: initialize

import io.dropwizard.assets.AssetsBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<AppConfiguration> bootstrap) {
    bootstrap.setConfigurationSourceProvider(
            new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(),
                    new EnvironmentVariableSubstitutor()
            )
    );

    /* Configure objectMapper to instantiate immutable configuration correctly */
    ObjectMapper objectMapper = bootstrap.getObjectMapper();
    objectMapper.registerModule(new JSR310Module());
    bootstrap.getObjectMapper()
            .setVisibilityChecker(objectMapper.getSerializationConfig().getDefaultVisibilityChecker()
                    .withFieldVisibility(JsonAutoDetect.Visibility.ANY)
                    .withGetterVisibility(JsonAutoDetect.Visibility.NONE)
                    .withSetterVisibility(JsonAutoDetect.Visibility.NONE)
                    .withCreatorVisibility(JsonAutoDetect.Visibility.NONE));

    /* Host static resources */
    bootstrap.addBundle((new AssetsBundle("/assets", "/", "index.html", "static")));

    /* Enable WebSockets support */
    bootstrap.addBundle(websocketBundle = new WebsocketBundle<>());
}
 
开发者ID:avoloshko,项目名称:WebCrawler,代码行数:25,代码来源:WebApp.java

示例6: initialize

import io.dropwizard.assets.AssetsBundle; //导入依赖的package包/类
@Override
public void initialize(final Bootstrap<AuthriteServiceConfiguration> bootstrap) {
    bootstrap.addBundle(new Java8Bundle());

    if (useClasspathAssets) {
        bootstrap.addBundle(new AssetsBundle("/assets/", "/"));
    } else {
        bootstrap.addBundle(new FileAssetsBundle("src/main/resources/assets", "/"));
    }

    bootstrap.addBundle(new MigrationsBundle<AuthriteServiceConfiguration>() {
        @Override
        public DataSourceFactory getDataSourceFactory(final AuthriteServiceConfiguration configuration) {
            return configuration.getDatabase();
        }
    });
}
 
开发者ID:lewisd32,项目名称:authrite,代码行数:18,代码来源:AuthriteServiceApplication.java

示例7: initialize

import io.dropwizard.assets.AssetsBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<LotteryConfiguration> bootstrap) {

    // set up folders for static content
    bootstrap.addBundle(new AssetsBundle("/assets/ajax", "/ajax", null, "ajax"));

    // tag::keycloak[]
    bootstrap.addBundle(new KeycloakBundle<LotteryConfiguration>() {
        @Override
        protected KeycloakConfiguration getKeycloakConfiguration(LotteryConfiguration configuration) {
            return configuration.getKeycloakConfiguration();
        }
        /* OPTIONAL: override getUserClass(), createAuthorizer() and createAuthenticator() if you want to use
        * a class other than de.ahus1.keycloak.dropwizard.User to be injected by @User*/
    });
    // end::keycloak[]
}
 
开发者ID:ahus1,项目名称:keycloak-dropwizard-integration,代码行数:18,代码来源:LotteryApplication.java

示例8: initialize

import io.dropwizard.assets.AssetsBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<LotteryConfiguration> bootstrap) {

    // set up folders for static content
    bootstrap.addBundle(new AssetsBundle("/assets/css", "/css", null, "css"));
    bootstrap.addBundle(new AssetsBundle("/assets/js", "/js", null, "js"));
    bootstrap.addBundle(new AssetsBundle("/assets/fonts", "/fonts", null, "fonts"));
    bootstrap.addBundle(new AssetsBundle("/assets/html", "/html", null, "html"));

    // setup Freemarker views.
    bootstrap.addBundle(new ViewBundle());

    // tag::keycloak[]
    bootstrap.addBundle(new KeycloakBundle<LotteryConfiguration>() {
        @Override
        protected KeycloakConfiguration getKeycloakConfiguration(LotteryConfiguration configuration) {
            return configuration.getKeycloakConfiguration();
        }
        /* OPTIONAL: override getUserClass(), createAuthorizer() and createAuthenticator() if you want to use
        * a class other than de.ahus1.keycloak.dropwizard.User to be injected by @User*/
    });
    // end::keycloak[]

}
 
开发者ID:ahus1,项目名称:keycloak-dropwizard-integration,代码行数:25,代码来源:LotteryApplication.java

示例9: initialize

import io.dropwizard.assets.AssetsBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<ExampleBootstrapConfigration> bootstrap) {
      //
      bootstrap.addBundle(new AssetsBundle("/templates/css","/css",null,"css"));
      bootstrap.addBundle(new AssetsBundle("/templates/js","/js",null,"js"));
      bootstrap.addBundle(new AssetsBundle("/templates/fonts","/fonts",null,"fonts"));

    ImmutableSet<ViewRenderer> renderes= ImmutableSet.of((ViewRenderer)new ThymeleafViewRenderer());
    bootstrap.addBundle(new ViewBundle(renderes));

 }
 
开发者ID:deffence1776,项目名称:dropwizard-views-thymeleaf,代码行数:12,代码来源:ExampleBootstrapAppication.java

示例10: initialize

import io.dropwizard.assets.AssetsBundle; //导入依赖的package包/类
@Override
    public void initialize(Bootstrap<CMSConfiguration> bootstrap) {
        bootstrap.addBundle(new ViewBundle());
        bootstrap.addBundle(new AssetsBundle());
//        bootstrap.addBundle(new AssetsBundle("/assets/css", "/css", null, "css"));
//        bootstrap.addBundle(new AssetsBundle("/assets/js", "/js", null, "js"));
//        bootstrap.addBundle(new AssetsBundle("/assets/fonts", "/fonts", null, "fonts"));
//        bootstrap.addBundle(new AssetsBundle("/assets/img", "/img", null, "img"));
    }
 
开发者ID:eeb,项目名称:dropwizard-mongo-cms,代码行数:10,代码来源:CMSApplication.java

示例11: initialize

import io.dropwizard.assets.AssetsBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<OntologyConfiguration> bootstrap) {
	// Add bundle for static asset directories
	bootstrap.addBundle(new AssetsBundle("/static", "/", "index.html", "static"));
	// Add webjars AssetsBundle, to include bootstrap, etc.
	bootstrap.addBundle(new AssetsBundle("/META-INF/resources/webjars", "/webjars", null, "webjars"));
}
 
开发者ID:flaxsearch,项目名称:BioSolr,代码行数:8,代码来源:OntologyApplication.java

示例12: initialize

import io.dropwizard.assets.AssetsBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<OntologyConfiguration> bootstrap) {
	// Add bundle for static asset directories
	bootstrap.addBundle(new AssetsBundle("/static", "/", "index.html", "static"));
	// Add webjars AssetsBundle, to include bootstrap, etc.
    bootstrap.addBundle(new AssetsBundle("/META-INF/resources/webjars", "/webjars", null, "webjars"));
}
 
开发者ID:flaxsearch,项目名称:BioSolr,代码行数:8,代码来源:OntologyApplication.java

示例13: initialize

import io.dropwizard.assets.AssetsBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<AppConfiguration> bootstrap) {
  
  ImmutableList<Class<?>> classes = scanForEntities();
  hibernate = new HibernateBundle<AppConfiguration>(classes, new SessionFactoryFactory()) {
@Override
public DataSourceFactory getDataSourceFactory(AppConfiguration configuration) {
	return configuration.getDatabase();
}
  };
  
  bootstrap.addBundle(hibernate);
  
  db = new DB();
  bootstrap.addBundle(new AssetsBundle("/assets/", "/", "index.htm"));
  
  devModule = new AppDevModule(db);
  bootstrap.addBundle(GuiceBundle.newBuilder()
                                 .addModule(devModule)
                                 .enableAutoConfig(getClass().getPackage().getName())
                                 .build());
}
 
开发者ID:yokuze,项目名称:dropwizard-backbone-app,代码行数:23,代码来源:AppService.java

示例14: initialize

import io.dropwizard.assets.AssetsBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<BaragonConfiguration> bootstrap) {
  if (!Strings.isNullOrEmpty(System.getProperty(BARAGON_DEFAULT_CONFIG_LOCATION))) {
    bootstrap.setConfigurationSourceProvider(
        new MergingConfigProvider(
            bootstrap.getConfigurationSourceProvider(),
            System.getProperty(BARAGON_DEFAULT_CONFIG_LOCATION),
            bootstrap.getObjectMapper(),
            new YAMLFactory()));
  }

  GuiceBundle<BaragonConfiguration> guiceBundle = GuiceBundle.defaultBuilder(BaragonConfiguration.class)
      .modules(new BaragonServiceModule())
      .modules(new MetricsInstrumentationModule(bootstrap.getMetricRegistry()))
      .modules(new BaragonResourcesModule())
      .build();

  bootstrap.addBundle(new CorsBundle());
  bootstrap.addBundle(new BaragonAuthBundle());
  bootstrap.addBundle(guiceBundle);
  bootstrap.addBundle(new ViewBundle<>());
  bootstrap.addBundle(new AssetsBundle("/assets/static/", "/static/"));
}
 
开发者ID:HubSpot,项目名称:Baragon,代码行数:24,代码来源:BaragonService.java

示例15: initialize

import io.dropwizard.assets.AssetsBundle; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<TimbuctooConfiguration> bootstrap) {
  //bundles
  activeMqBundle = new ActiveMQBundle();
  bootstrap.addBundle(activeMqBundle);
  bootstrap.addBundle(new MultiPartBundle());
  bootstrap.addBundle(new AssetsBundle("/static", "/static", "index.html"));
  /*
   * Make it possible to use environment variables in the config.
   * see: http://www.dropwizard.io/0.9.1/docs/manual/core.html#environment-variables
   */
  bootstrap.setConfigurationSourceProvider(
    new SubstitutingSourceProvider(
      bootstrap.getConfigurationSourceProvider(),
      new EnvironmentVariableSubstitutor(true)
    ));
}
 
开发者ID:HuygensING,项目名称:timbuctoo,代码行数:18,代码来源:TimbuctooV4.java


注:本文中的io.dropwizard.assets.AssetsBundle类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。