Top Description Fields Constructors Methods
org.apache.tomcat.util.http.fileupload

public Class InvalidFileNameException

extends RuntimeException
Class Inheritance

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.

Field Summary

Modifier and TypeField and Description
private final String
name

The file name causing the exception.

private static final long
serialVersionUID

Hides java.lang.RuntimeException.serialVersionUID.

Serial version UID, being used, if the exception is serialized.

Constructor Summary

AccessConstructor and Description
public
InvalidFileNameException(final String
The file name causing the exception.
pName
,
final String
A human readable error message.
pMessage
)

Creates a new instance.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the invalid file name.
getName
()

Returns the invalid file name.

Field Detail

nameback to summary
private final String name

The file name causing the exception.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.RuntimeException.serialVersionUID.

Serial version UID, being used, if the exception is serialized.

Constructor Detail

InvalidFileNameExceptionback to summary
public InvalidFileNameException(final String pName, final String pMessage)

Creates a new instance.

Parameters
pName:String

The file name causing the exception.

pMessage:String

A human readable error message.

Method Detail

getNameback to summary
public String getName()

Returns the invalid file name.

Returns:String

the invalid file name.