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


Java EncodingFilter类代码示例

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


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

示例1: createJerseyTest

import org.glassfish.jersey.server.filter.EncodingFilter; //导入依赖的package包/类
private JerseyTest createJerseyTest(Boolean binaryCompressionOnly) {
	return new JerseyTest() {
		@Override
		protected Application configure() {
			ResourceConfig config = new ResourceConfig();
			config.register(TestResource.class);
			config.register(EncodingFilter.class);
			config.register(GZipEncoder.class);
			config.register(GatewayBinaryResponseFilter.class);
			if (binaryCompressionOnly != null) {
				config.property(GatewayBinaryResponseFilter.BINARY_COMPRESSION_ONLY_PROPERTY,
						binaryCompressionOnly);
			}
			return config;
		}
	};
}
 
开发者ID:bbilger,项目名称:jrestless,代码行数:18,代码来源:GatewayBinaryResponseFilterIntTest.java

示例2: Main

import org.glassfish.jersey.server.filter.EncodingFilter; //导入依赖的package包/类
private Main() {
    packages("us.askplatyp.kb.lucene.http");

    register(JacksonFeature.class);
    register(EntityFilteringFeature.class);
    register(new AbstractBinder() {
        @Override
        protected void configure() {
            bindFactory(WikidataLuceneIndexFactory.class).to(LuceneIndex.class);
        }
    });
    register(CORSFilter.class);
    register(ApiListingResource.class);
    register(SwaggerSerializers.class);
    EncodingFilter.enableFor(this, GZipEncoder.class);
    EncodingFilter.enableFor(this, DeflateEncoder.class);

    configureSwagger();
}
 
开发者ID:askplatypus,项目名称:platypus-kb-lucene,代码行数:20,代码来源:Main.java

示例3: RackApiApplicationConfig

import org.glassfish.jersey.server.filter.EncodingFilter; //导入依赖的package包/类
/**
 * コンストラクタです。
 */
public RackApiApplicationConfig() {

    packages(RackApiScanPackage.class.getPackage().getName());
    packages(ConnectorScanPackage.class.getPackage().getName());
    packages(SpringLifecycleListener.class.getPackage().getName());
    property(ServerProperties.JSON_PROCESSING_FEATURE_DISABLE, true);
    property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);
    register(ValidationConfigurationContextResolver.class);
    register(JacksonFeature.class);
    register(LoggingFilter.class);
    register(LocaleContextFilter.class);
    register(EncodingFilter.class);
    register(GZipEncoder.class);
    registerClasses(JerseyConfigs.getExcpetionMappers());
}
 
开发者ID:ctc-g,项目名称:rack-java,代码行数:19,代码来源:RackApiApplicationConfig.java

示例4: RestResourceConfig

import org.glassfish.jersey.server.filter.EncodingFilter; //导入依赖的package包/类
public RestResourceConfig() {
	log.info("-----------------------------loading JERSEY2 restful---------------------------");
 	packages("com.framework.rest.service");
 register(RestAuthRequestFilter.class);
 register(RestResponseFilter.class);
 register(LoggingFilter.class);
 register(JacksonFeature.class);
 register(DeflateEncoder.class);
 EncodingFilter.enableFor(this, GZipEncoder.class);
}
 
开发者ID:handexing,项目名称:frameworkAggregate,代码行数:11,代码来源:RestResourceConfig.java

示例5: JerseyConfig

import org.glassfish.jersey.server.filter.EncodingFilter; //导入依赖的package包/类
public JerseyConfig() {
      log.info("Registering classes");
      register(AppConfiguration.class);
      packages("com.pokebattler.fight.data");
      packages("com.pokebattler.fight.resources");
      register(ProtobufJsonProvider.class);
      register(ProtobufBinaryProvider.class);
      // need to be in order
      register(ETagResponseFilter.class);
      register(CORSResponseFilter.class);
      register(CacheControlResponseFilter.class);

      register(EntityFilteringFeature.class);
EncodingFilter.enableFor(this, GZipEncoder.class);
  }
 
开发者ID:celandro,项目名称:pokebattler-fight,代码行数:16,代码来源:JerseyConfig.java

示例6: configure

import org.glassfish.jersey.server.filter.EncodingFilter; //导入依赖的package包/类
@Override
protected Application configure() {
    return new ResourceConfig(MockServer.class)
            .register(RolesAllowedDynamicFeature.class)
            .register(new MockSecurityFilter(), Priorities.AUTHENTICATION)
            .register(JerseyClient.createMoxyJsonResolver())
            .register(GZipEncoder.class)
            .register(EncodingFilter.class);
}
 
开发者ID:BCDH,项目名称:TEI-Authorizer,代码行数:10,代码来源:JerseyClientTest.java

示例7: createAndStartHandler

import org.glassfish.jersey.server.filter.EncodingFilter; //导入依赖的package包/类
private GatewayRequestObjectHandlerImpl createAndStartHandler(ResourceConfig config, TestService testService) {
	config.register(GatewayFeature.class);
	Binder binder = new InstanceBinder.Builder().addInstance(testService, TestService.class).build();
	config.register(binder);
	config.register(TestResource.class);
	config.register(EncodingFilter.class);
	config.register(GZipEncoder.class);
	config.register(SomeCheckedAppExceptionMapper.class);
	config.register(SomeUncheckedAppExceptionMapper.class);
	config.register(GlobalExceptionMapper.class);
	GatewayRequestObjectHandlerImpl handler = new GatewayRequestObjectHandlerImpl();
	handler.init(config);
	handler.start();
	return handler;
}
 
开发者ID:bbilger,项目名称:jrestless,代码行数:16,代码来源:GatewayRequestObjectHandlerIntTest.java

示例8: RequestHandler

import org.glassfish.jersey.server.filter.EncodingFilter; //导入依赖的package包/类
public RequestHandler() {
	// configure the application with the resource
	init(new ResourceConfig()
			.register(GatewayFeature.class)
			.register(MultiPartFeature.class)
			.register(EncodingFilter.class)
			.register(GZipEncoder.class)
			.packages("com.jrestless.aws.examples"));
	start();
}
 
开发者ID:bbilger,项目名称:jrestless-examples,代码行数:11,代码来源:RequestHandler.java

示例9: registerStuff

import org.glassfish.jersey.server.filter.EncodingFilter; //导入依赖的package包/类
protected static void registerStuff(ResourceConfig rConfig) {

    rConfig.register(AccessOriginFilter.class);
    /*
     * rConfig.register(ErrorMapper.class);
     * rConfig.register(PreFilter.class);
     * rConfig.register(PostFilter.class);
     */
    rConfig.register(GenericExceptionMapper.class);
    rConfig.register(org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainerProvider.class);
    EncodingFilter.enableFor(rConfig, GZipEncoder.class);
    rConfig.register(JsonIteratorConverter.class);
  }
 
开发者ID:cubedb,项目名称:cubedb,代码行数:14,代码来源:CubeApplication.java

示例10: createHttpServer

import org.glassfish.jersey.server.filter.EncodingFilter; //导入依赖的package包/类
private HttpServer createHttpServer()
    throws IOException, IllegalArgumentException, UriBuilderException, URISyntaxException {
    ResourceConfig resourceConfig = new ResourceConfig()
        .packages(true, Configuration.instance().getStrings("APP.Jersey.Resources").toArray(new String[0]))
        .register(FrontendFeature.class);
    EncodingFilter.enableFor(resourceConfig, GZipEncoder.class);
    return GrizzlyHttpServerFactory.createHttpServer(getURI(), resourceConfig, false);
}
 
开发者ID:MyCoRe-Org,项目名称:MyVidCoRe,代码行数:9,代码来源:EmbeddedHttpServer.java

示例11: RestDemoJaxRsApplication

import org.glassfish.jersey.server.filter.EncodingFilter; //导入依赖的package包/类
/**
	 * Register JAX-RS application components.
	 */
	public RestDemoJaxRsApplication() {
		
        packages("org.codingpedia.demo.rest");
        
//		// register application resources
//		register(PodcastsResource.class);
//		register(PodcastLegacyResource.class);
//
//		// register filters
//		register(RequestContextFilter.class);
//		register(LoggingResponseFilter.class);
//		register(CORSResponseFilter.class);
//
//		// register exception mappers
//		register(GenericExceptionMapper.class);
//		register(AppExceptionMapper.class);
//      register(CustomReasonPhraseExceptionMapper.class);
//		register(NotFoundExceptionMapper.class);
//
//		// register features
//		register(JacksonFeature.class);
		register(EntityFilteringFeature.class);
		EncodingFilter.enableFor(this, GZipEncoder.class);		
		
//		property(EntityFilteringFeature.ENTITY_FILTERING_SCOPE, new Annotation[] {PodcastDetailedView.Factory.get()});
	}
 
开发者ID:Codingpedia,项目名称:demo-rest-jersey-spring,代码行数:30,代码来源:RestDemoJaxRsApplication.java

示例12: deploy

import org.glassfish.jersey.server.filter.EncodingFilter; //导入依赖的package包/类
@Override
public void deploy(WebAppContext context) {
    context.addFilter(new FilterHolder(maintenanceModeFilter), "/whois/*", EnumSet.allOf(DispatcherType.class));

    final ResourceConfig resourceConfig = new ResourceConfig();
    EncodingFilter.enableFor(resourceConfig, GZipEncoder.class);
    EncodingFilter.enableFor(resourceConfig, DeflateEncoder.class);
    resourceConfig.register(MultiPartFeature.class);
    resourceConfig.register(whoisRestService);
    resourceConfig.register(whoisSearchService);
    resourceConfig.register(whoisVersionService);
    resourceConfig.register(syncUpdatesService);
    resourceConfig.register(asnTransfersRestService);
    resourceConfig.register(inetnumTransfersRestService);
    resourceConfig.register(whoisMetadata);
    resourceConfig.register(geolocationService);
    resourceConfig.register(abuseContactService);
    resourceConfig.register(autocompleteService);
    resourceConfig.register(referencesService);
    resourceConfig.register(defaultExceptionMapper);
    resourceConfig.register(domainObjectService);
    resourceConfig.register(fullTextSearch);
    resourceConfig.register(batchUpdatesService);
    resourceConfig.register(new CacheControlFilter());

    final JacksonJaxbJsonProvider jaxbJsonProvider = new JacksonJaxbJsonProvider();
    jaxbJsonProvider.configure(SerializationFeature.INDENT_OUTPUT, true);
    jaxbJsonProvider.configure(SerializationFeature.WRAP_ROOT_VALUE, false);
    resourceConfig.register(jaxbJsonProvider);

    // only allow cross-origin requests from ripe.net
    final FilterHolder crossOriginFilterHolder = context.addFilter(org.eclipse.jetty.servlets.CrossOriginFilter.class, "/whois/*", EnumSet.allOf(DispatcherType.class));
    crossOriginFilterHolder.setInitParameter(org.eclipse.jetty.servlets.CrossOriginFilter.ALLOWED_ORIGINS_PARAM, "https?://*.ripe.net");

    context.addServlet(new ServletHolder("Whois REST API", new ServletContainer(resourceConfig)), "/whois/*");
}
 
开发者ID:RIPE-NCC,项目名称:whois,代码行数:37,代码来源:WhoisServletDeployer.java

示例13: MockWebApplication

import org.glassfish.jersey.server.filter.EncodingFilter; //导入依赖的package包/类
public MockWebApplication(boolean operational, long timeout) {
    Set<Class<?>> classes = new HashSet<Class<?>>();
    classes.add(EncodingFilter.class);
    classes.add(GZipEncoder.class);
    classes.add(ClientEncodingAssertingFilter.class);
    this.classes = Collections.unmodifiableSet(classes);
    Set<Object> singletons = new HashSet<Object>();
    singletons.add(new MockWebService(operational, timeout));
    this.singletons = Collections.unmodifiableSet(singletons);
}
 
开发者ID:documents4j,项目名称:documents4j,代码行数:11,代码来源:MockWebApplication.java

示例14: WebConverterApplication

import org.glassfish.jersey.server.filter.EncodingFilter; //导入依赖的package包/类
public WebConverterApplication(IWebConverterConfiguration webConverterConfiguration) {
    Set<Class<?>> classes = new HashSet<Class<?>>();
    classes.add(ConverterResource.class);
    classes.add(EncodingFilter.class);
    classes.add(GZipEncoder.class);
    this.classes = Collections.unmodifiableSet(classes);
    Set<Object> singletons = new HashSet<Object>();
    singletons.add(new WebConverterConfigurationBinder(webConverterConfiguration));
    this.singletons = Collections.unmodifiableSet(singletons);
}
 
开发者ID:documents4j,项目名称:documents4j,代码行数:11,代码来源:WebConverterApplication.java

示例15: enableContentEncodingGzip

import org.glassfish.jersey.server.filter.EncodingFilter; //导入依赖的package包/类
private void enableContentEncodingGzip(Environment environment) {
  EncodingFilter.enableFor(environment.jersey().getResourceConfig(), GZipEncoder.class);
}
 
开发者ID:dehora,项目名称:outland,代码行数:4,代码来源:ServerMain.java


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