ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/jakarta/servlet/HttpMethodConstraintElement.java

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

      
    
Rootfs path

      
    
Size
2766 (2.7 KB)
MD5
a32cf9317813357425054d46b1ae66db
SHA1
f78cfec1f8095abf6f87cc6ca66ccf65f141a3ff
SHA256
d86d1804c2e32fa50a998bbc93d2e3a789c4f3c3734ebbdf266831616874ad61
SHA512

      
    
SHA1_git
0e458f6fc6edf4dbd8e5b6479c5b6f94c8883159
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
HttpMethodConstraintElement.java | 2.7 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 jakarta.servlet; import java.util.ResourceBundle; /** * Programmatic equivalent of a security constraint defined for a single HTTP method. * * @since Servlet 3.0 */ public class HttpMethodConstraintElement extends HttpConstraintElement { // Can't inherit from HttpConstraintElement as API does not allow it private static final String LSTRING_FILE = "jakarta.servlet.LocalStrings"; private static final ResourceBundle lStrings = ResourceBundle.getBundle(LSTRING_FILE); private final String methodName; /** * Construct an instance for the given HTTP method name and a default {@link HttpConstraintElement}. * * @param methodName The HTTP method name */ public HttpMethodConstraintElement(String methodName) { if (methodName == null || methodName.isEmpty()) { throw new IllegalArgumentException(lStrings.getString("httpMethodConstraintElement.invalidMethod")); } this.methodName = methodName; } /** * Construct an instance for the given HTTP method name and {@link HttpConstraintElement}. * * @param methodName The HTTP method name * @param constraint The constraint for the given method */ public HttpMethodConstraintElement(String methodName, HttpConstraintElement constraint) { super(constraint.getEmptyRoleSemantic(), constraint.getTransportGuarantee(), constraint.getRolesAllowed()); if (methodName == null || methodName.isEmpty()) { throw new IllegalArgumentException(lStrings.getString("httpMethodConstraintElement.invalidMethod")); } this.methodName = methodName; } /** * Obtain the name of the HTTP method for which this constraint was created. * * @return The HTTP method name as provided to the constructor */ public String getMethodName() { return methodName; } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
40.07
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