本文整理汇总了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);
}
示例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)
)
);
}
示例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");
}
示例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));
}
示例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<>());
}
示例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();
}
});
}
示例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[]
}
示例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[]
}
示例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));
}
示例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"));
}
示例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"));
}
示例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"));
}
示例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());
}
示例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/"));
}
示例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)
));
}