ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/tomcat/util/http/fileupload/InvalidFileNameException.java

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

      
    
Rootfs path

      
    
Size
2200 (2.1 KB)
MD5
e73dab5c91cb116678ca0f7edf5191af
SHA1
87c0537290f502d13a9e79a214ef2cfe8c587193
SHA256
8dd7a15f6feb1b28111ebb3c72ef025d17a47d50b9c707a22489e18d7fa65487
SHA512

      
    
SHA1_git
66190878ef4151da810f6107ed3da2b497c68b25
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
InvalidFileNameException.java | 2.1 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.tomcat.util.http.fileupload; /** * This exception is thrown in case of an invalid file name. * A file name is invalid, if it contains a NUL character. * Attackers might use this to circumvent security checks: * For example, a malicious user might upload a file with the name * "foo.exe\0.png". This file name might pass security checks (i.e. * checks for the extension ".png"), while, depending on the underlying * C library, it might create a file named "foo.exe", as the NUL * character is the string terminator in C. */ public class InvalidFileNameException extends RuntimeException { /** * Serial version UID, being used, if the exception * is serialized. */ private static final long serialVersionUID = 7922042602454350470L; /** * The file name causing the exception. */ private final String name; /** * Creates a new instance. * * @param name The file name causing the exception. * @param message A human readable error message. */ public InvalidFileNameException(final String name, final String message) { super(message); this.name = name; } /** * Returns the invalid file name. * * @return the invalid file name. */ public String getName() { return name; } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
42.35
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