java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
java.nio.file.FileSystemException
- 所有已实现的接口:
-
Serializable
- 直接已知的子类:
-
AccessDeniedException,AtomicMoveNotSupportedException,DirectoryNotEmptyException,FileAlreadyExistsException,FileSystemLoopException,NoSuchFileException,NotDirectoryException,NotLinkException
当一个文件系统操作在一个或两个文件上失败时抛出。这个类是文件系统异常的通用类。
- 自从:
- 1.7
- 参见:
-
Constructor Summary
ConstructorsConstructorDescriptionFileSystemException(String file) 构造此类的一个实例。FileSystemException(String file, String other, String reason) 构造此类的一个实例。 -
Method Summary
Modifier and TypeMethodDescriptiongetFile()返回用于创建此异常的文件。返回详细消息字符串。返回用于创建此异常的另一个文件。返回解释文件系统操作失败原因的字符串。Methods declared in class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
FileSystemException
构造此类的一个实例。当涉及一个文件的操作失败且没有额外信息来解释原因时应使用此构造函数。- 参数:
-
file- 标识文件的字符串,如果不知道则为null。
-
FileSystemException
构造此类的一个实例。当涉及两个文件的操作失败,或者有额外信息来解释原因时应使用此构造函数。- 参数:
-
file- 标识文件的字符串,如果不知道则为null。 -
other- 标识另一个文件的字符串,如果没有另一个文件或者不知道则为null。 -
reason- 带有额外信息的原因消息,或者为null。
-
-
Method Details
-
getFile
返回用于创建此异常的文件。- 返回:
-
文件(可以为
null)
-
getOtherFile
返回用于创建此异常的另一个文件。- 返回:
-
另一个文件(可以为
null)
-
getReason
返回解释文件系统操作失败原因的字符串。- 返回:
- 解释文件系统操作失败原因的字符串
-
getMessage
返回详细消息字符串。- 覆盖:
-
getMessage在类Throwable - 返回:
-
此
Throwable实例的详细消息字符串(可能为null)。
-