Adapts a filter with {@link URI} base type to a filter with {@link HttpResponseWarcRecord} base type.

@param original the original filter.
@return the adapted filter.
357610
public static Filter<HttpResponseWarcRecord> adaptFilterURI2HttpResponseWarcRecord(final Filter<URI> original) {
		return new AbstractFilter<HttpResponseWarcRecord>() {
			@Override
			public boolean apply(final HttpResponseWarcRecord response) {
				return original.apply(response.getWarcTargetURI());
			}
			@Override
			public String toString() {
				return original.toString();
			}
			@Override
			public Filter<HttpResponseWarcRecord> copy() {
				return adaptFilterURI2HttpResponseWarcRecord(original.copy());
			}
		};
	}
357339
public org.osgi.framework.Filter createOsgiFilter()
        throws IllegalArgumentException {
        org.osgi.framework.Filter filter;
        try {
            String filterString = String.format("(&(%s=%s)(%s=%s))", APPLICATION_NAME, applicationName,
                OBJECTCLASS, FilterFactory.class.getName());
            LOGGER.debug("createOsgiFilter={} for application {}", filterString, applicationName);
            filter = bundleContext.createFilter(filterString);
        } catch (InvalidSyntaxException e) {
            throw new IllegalArgumentException("applicationName can not contain '*', '(' or ')' : " + applicationName,
                e);
        }
        return filter;
    }
353393
private CaptureSearchResult genericResult(WARCRecord rec) {

		CaptureSearchResult result = new CaptureSearchResult();

		result.setMimeType(DEFAULT_VALUE);
		result.setHttpCode(DEFAULT_VALUE);
		result.setRedirectUrl(DEFAULT_VALUE);

		ArchiveRecordHeader header = rec.getHeader();

		String file = transformWARCFilename(header.getReaderIdentifier());
		long offset = header.getOffset();
		
		result.setCaptureTimestamp(transformWARCDate(header.getDate()));
		result.setFile(file);
		result.setOffset(offset);
		result.setDigest(transformWARCDigest(header.getHeaderValue(
				WARCRecord.HEADER_KEY_PAYLOAD_DIGEST)));
		
		String origUrl = header.getUrl();
		if(origUrl == null) {
			String type = header.getHeaderValue(WARCConstants.HEADER_KEY_TYPE).toString();
			if(type.equals(WARCConstants.WARCRecordType.warcinfo)) {
				String filename = header.getHeaderValue(
						WARCConstants.HEADER_KEY_FILENAME).toString();
				result.setOriginalUrl("filedesc:"+filename);
				result.setUrlKey("filedesc:"+filename);				
			} else {
				result.setOriginalUrl(DEFAULT_VALUE);
				result.setUrlKey(DEFAULT_VALUE);
			}

			
		} else {
			result.setOriginalUrl(origUrl);
			try {
				String urlKey = canonicalizer.urlStringToKey(origUrl);
				result.setUrlKey(urlKey);
			} catch (URIException e) {
				String shortUrl = 
					(origUrl.length() < 100) 
					? origUrl
					:origUrl.substring(0,100);
				LOGGER.warning("FAILED canonicalize(" + shortUrl + "):" + 
						file + " " + offset);
				result.setUrlKey(origUrl);
			}
		}
		return result;
	}
592246
@SuppressWarnings("unchecked")
  public <T extends RequestFilter> T requestFilter(String name) {
    return (T) requestFilters.get(name);
  }
350012
@DependsOn("applicationContextProvider")
	@Bean
	public WebServerFactoryCustomizer<ConfigurableServletWebServerFactory> rewriteWebServerFactoryCustomizer() {
		return factory -> factory.addInitializers(servletContext -> {
			servletContext.addListener(new RewriteServletContextListener());
			servletContext.addListener(new RewriteServletRequestListener());

			FilterRegistration.Dynamic rewriteFilterRegistration = servletContext.addFilter("OCPsoft Rewrite Filter", RewriteFilter.class);
			rewriteFilterRegistration.setAsyncSupported(true);
			rewriteFilterRegistration.addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), false, "/*");
		});
	}
1007972
public URI proxy(URI uri) {
        Proxy conf;
        String scheme;

        scheme = uri.getScheme();
        conf = proxies.get(scheme);
        if (conf == null || conf.excludes(uri)) {
            return null;
        }
        try {
            return new URI(scheme, null, conf.host, conf.port, null, null, null);
        } catch (URISyntaxException e) {
            throw new IllegalArgumentException(e);
        }
    }
272410
public static Filter.Builder makeAncestorFilter(Key ancestor) {
    return makeFilter(
        DatastoreHelper.KEY_PROPERTY_NAME, PropertyFilter.Operator.HAS_ANCESTOR,
        makeValue(ancestor));
  }
912971
@Override
	public int filterObject(CaptureSearchResult r) {
		String captureScheme = UrlOperations.urlToScheme(r.getOriginalUrl());
		if(scheme == null) {
			if(captureScheme == null) {
				return FILTER_INCLUDE;
			} else {
				annotationTarget.addCloseMatch(r.getOriginalHost(),
						r.getOriginalUrl());
				return FILTER_EXCLUDE;
			}
		}

		if(scheme.equals(captureScheme)) {
			return FILTER_INCLUDE;
		} else {
			if(annotationTarget != null) {
				annotationTarget.addCloseMatch(r.getOriginalHost(),
						r.getOriginalUrl());
			}
			 return FILTER_EXCLUDE;
		}
	}
21962
@Override
    public BlobContract withFilter(ServiceFilter filter) {
        ClientFilter[] currentFilters = getFilters();
        ClientFilter[] newFilters = Arrays.copyOf(currentFilters,
                currentFilters.length + 1);
        newFilters[currentFilters.length] = new ClientFilterAdapter(filter);
        return new MediaBlobRestProxy(getChannel(), newFilters,
                getAccountName(), getUrl(), this.tokenFilter, getDateMapper());
    }
164804
public static String relativize(String base, String uri)
	{
		URI child = URI.create( raw( uri ) );
		URI parent = URI.create( raw( base ) );
		return parent.relativize( child ).getPath();
	}
468554
@Override
    public String getRestURI(String baseServiceURI) {

        StringBuilder requestURI = new StringBuilder();
        
        requestURI.append(baseServiceURI);

        if (StringUtils.isNotBlank(entityName)) {
            appendToURI(requestURI, entityName);
            if (StringUtils.isNotBlank(entityVersion)) {
                appendToURI(requestURI, entityVersion);
            }
        }
        if (StringUtils.isNotBlank(getOperationPathParam())) {
            appendToURI(requestURI, getOperationPathParam());
        }

        return requestURI.toString();
    }
1179427
public static responderaction[] get_filtered(nitro_service service, String filter) throws Exception{
		responderaction obj = new responderaction();
		options option = new options();
		option.set_filter(filter);
		responderaction[] response = (responderaction[]) obj.getfiltered(service, option);
		return response;
	}
176834
public static transformaction[] get_filtered(nitro_service service, String filter) throws Exception{
		transformaction obj = new transformaction();
		options option = new options();
		option.set_filter(filter);
		transformaction[] response = (transformaction[]) obj.getfiltered(service, option);
		return response;
	}
1188107
static FilterMetadata getFilterMetadata(HttpSupportFilter filter){
        FilterMetadata config = filterMetadataMap.get(filter);
        if(config == null){
            config = new FilterMetadata();
            filterMetadataMap.put(filter, config);
        }
        return config;
    }
1200902
@Nonnull
  public static EChange setResponseDeflateEnabled (final boolean bResponseDeflateEnabled)
  {
    return s_aRWLock.writeLocked ( () -> {
      if (s_bResponseDeflateEnabled == bResponseDeflateEnabled)
        return EChange.UNCHANGED;
      s_bResponseDeflateEnabled = bResponseDeflateEnabled;
      LOGGER.info ("CompressFilter responseDeflateEnabled=" + bResponseDeflateEnabled);
      return EChange.CHANGED;
    });
  }
848592
public static ContentMapping of(@Nonnull String original, @Nonnull String replacement) {
        return new ContentMapping(original, replacement);
    }
805786
public TypeReferenceAdjustment filter(ElementMatcher<? super TypeDescription> filter) {
        return new TypeReferenceAdjustment(strict, this.filter.<TypeDescription>or(filter));
    }