io.dropwizard.forms.MultiPartBundle Java Examples

The following examples show how to use io.dropwizard.forms.MultiPartBundle. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TimbuctooV4.java    From timbuctoo with GNU General Public License v3.0 6 votes vote down vote up
@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)
    ));
}
 
Example #2
Source File: JophielApplication.java    From judgels with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void initialize(Bootstrap<JophielApplicationConfiguration> bootstrap) {
    JudgelsObjectMappers.configure(bootstrap.getObjectMapper());

    bootstrap.addBundle(hibernateBundle);
    bootstrap.addBundle(new MultiPartBundle());
    bootstrap.addBundle(new JophielMigrationsBundle());
    bootstrap.addBundle(new WebSecurityBundle());
}
 
Example #3
Source File: JerahmeelApplication.java    From judgels with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void initialize(Bootstrap<JerahmeelApplicationConfiguration> bootstrap) {
    JudgelsObjectMappers.configure(bootstrap.getObjectMapper());

    bootstrap.addBundle(hibernateBundle);
    bootstrap.addBundle(new MultiPartBundle());
    bootstrap.addBundle(new JerahmeelMigrationsBundle());
    bootstrap.addBundle(new WebSecurityBundle());
}
 
Example #4
Source File: UrielApplication.java    From judgels with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void initialize(Bootstrap<UrielApplicationConfiguration> bootstrap) {
    JudgelsObjectMappers.configure(bootstrap.getObjectMapper());

    bootstrap.addBundle(hibernateBundle);
    bootstrap.addBundle(new MultiPartBundle());
    bootstrap.addBundle(new UrielMigrationsBundle());
    bootstrap.addBundle(new WebSecurityBundle());
}
 
Example #5
Source File: RufusApplication.java    From rufus with MIT License 5 votes vote down vote up
@Override
public void initialize(Bootstrap<RufusConfiguration> bootstrap) {
    bootstrap.addBundle(new AssetsBundle("/app", "/", "index.html"));
    bootstrap.addBundle(new ViewBundle<>());
    bootstrap.addBundle(new MultiPartBundle());
    bootstrap.addBundle(new MigrationsBundle<RufusConfiguration>() {
        @Override
        public DataSourceFactory getDataSourceFactory(RufusConfiguration conf) {
            return conf.getDataSourceFactory();
        }
    });
}
 
Example #6
Source File: IronTestApplication.java    From irontest with Apache License 2.0 4 votes vote down vote up
@Override
public void initialize(Bootstrap<IronTestConfiguration> bootstrap) {
    bootstrap.addCommand(new UpgradeCommand());

    bootstrap.addBundle(new AssetsBundle("/assets/app", "/ui", "index.htm", "ui"));
    bootstrap.addBundle(new AssetsBundle("/META-INF/resources/webjars", "/ui/lib", null, "lib"));
    bootstrap.addBundle(new AssetsBundle("/assets/mockserver", "/ui/mockserver", "mockserver.htm", "mockserver"));
    bootstrap.addBundle(new AssetsBundle("/assets/common", "/ui/common", null, "common"));
    bootstrap.addBundle(jaxWsBundle);
    bootstrap.addBundle(new MultiPartBundle());
    bootstrap.addBundle(new ViewBundle<IronTestConfiguration>(){
        @Override
        public Map<String, Map<String, String>> getViewConfiguration(IronTestConfiguration config) {
            return config.getViewRendererConfiguration();
        }
    });
    Configuration.setDefaults(new Configuration.Defaults() {
        private final JsonProvider jsonProvider = new JacksonJsonProvider();
        private final MappingProvider mappingProvider = new JacksonMappingProvider();

        @Override
        public JsonProvider jsonProvider() {
            return jsonProvider;
        }

        @Override
        public MappingProvider mappingProvider() {
            return mappingProvider;
        }

        @Override
        public Set<Option> options() {
            return EnumSet.noneOf(Option.class);
        }
    });

    //  configure the Jackson ObjectMapper used by JAX-RS (Jersey)
    ObjectMapper objectMapper = bootstrap.getObjectMapper();
    objectMapper.disable(MapperFeature.DEFAULT_VIEW_INCLUSION);
    IronTestUtils.addMixInsForWireMock(objectMapper);
}