ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/catalina/valves/rewrite/RewriteMap.java

Path
ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/catalina/valves/rewrite/RewriteMap.java
Status
scanned
Type
file
Name
RewriteMap.java
Extension
.java
Programming language
Java
Mime type
text/plain
File type
ASCII text, with CRLF line terminators
Tag

      
    
Rootfs path

      
    
Size
2938 (2.9 KB)
MD5
a6a11ff0208a4fba3d174acc0e8bde3c
SHA1
c0456f7961648b1fef6e5e3252a516794a1368c7
SHA256
a631dea4be0a5a1f295c26355edfa6b79048f707e66cf8194a18cd4434334ece
SHA512

      
    
SHA1_git
6b2e0da70f42725b27863b2e4196964f04bf64b4
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
RewriteMap.java | 2.9 KB |

/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.catalina.valves.rewrite; import org.apache.tomcat.util.res.StringManager; /** * Interface for user defined lookup/replacement logic that can be defined in a {@code rewrite.config} file by a * {@code RewriteMap} directive. Such a map can then be used by a {@code RewriteRule} defined in the same file. * <p> * An example {@code rewrite.config} file could look like: * * <pre> * RewriteMap uc example.UpperCaseMap * * RewriteRule ^/(.*)$ ${uc:$1} * </pre> * * One parameter can be optionally appended to the {@code RewriteMap} directive. This could be used &ndash; for example * &ndash; to specify a name of a file, that contains a lookup table used by the implementation of the map. */ public interface RewriteMap { /** * Optional parameter that can be defined through the {@code RewriteMap} directive in the {@code rewrite.config} * file. * * @param params the optional parameter * * @return value is currently ignored */ String setParameters(String params); /** * Optional parameters that can be defined through the {@code RewriteMap} directive in the {@code rewrite.config} * file. * <p> * This method will be called, if there is more than one parameter defined. * * @param params the optional parameters */ default void setParameters(String... params) { if (params == null) { return; } if (params.length > 1) { throw new IllegalArgumentException( StringManager.getManager(RewriteMap.class).getString("rewriteMap.tooManyParameters")); } setParameters(params[0]); } /** * Maps a key to a replacement value.<br> * The method is free to return {@code null} to indicate, that the default value from the {@code RewriteRule} * directive should be used. * * @param key used by the actual implementation to generate a mapped value * * @return mapped value or {@code null} */ String lookup(String key); }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
33.33
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-4bde3f57-78aa-4201-96bf-531cba09e7de apache-2.0 Apache-2.0
URL Start line End line
http://www.apache.org/licenses/LICENSE-2.0 9 9