public class FileExistsException extends IOException
This exception may denote either an error of the caller (in case it previously created the
specified file) or an external modification to the FileStore
resulting in the external
creation of a file with the same filename. Mandatory property getFilename()
provides
the name of the existing file.
Note: a specific exception has been introduced as the existing
java.nio.file.FileAlreadyExistsException
is strictly related to the JDK FileSystem
class and to the access to files on OS-managed filesystems.
Constructor and Description |
---|
FileExistsException(String filename,
String message)
Creates a new instance with the filename and additional error message specified.
|
FileExistsException(String filename,
String message,
Throwable cause)
Creates a new instance with the filename, additional error message and cuase specified.
|
Modifier and Type | Method and Description |
---|---|
String |
getFilename()
Returns the filename identifying the existing file.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public FileExistsException(String filename, @Nullable String message)
filename
- the filename identifying the existing filemessage
- an optional message providing additional information, which is concatenated to
an auto-generated message reporting the filename of the existing fileFileExistsException(String, String, Throwable)
public FileExistsException(String filename, @Nullable String message, @Nullable Throwable cause)
filename
- the filename identifying the existing filemessage
- an optional message providing additional information, which is concatenated to
an auto-generated message reporting the filename of the existing filecause
- an optional cause of this exceptionpublic final String getFilename()
Copyright © 2015–2016 FBK-irst. All rights reserved.