您的位置:58脚本 > 鸿蒙OS FileNotFoundException

鸿蒙OS FileNotFoundException

2023-05-10 23:32 鸿蒙OS开发文档

 鸿蒙OS FileNotFoundException

FileNotFoundException

java.lang.Object

|---java.lang.Throwable

|---|---java.lang.Exception

|---|---|---java.io.IOException

|---|---|---|---java.io.FileNotFoundException

public class FileNotFoundException
extends IOException

表示尝试打开由指定路径名表示的文件失败的信号。

当具有指定路径名的文件不存在时,FileInputStream、FileOutputStream 和 RandomAccessFile 构造函数将引发此异常。 如果文件确实存在但由于某种原因不可访问,例如当试图打开只读文件进行写入时,这些构造函数也会抛出它。

Since:

JDK1.0

构造函数摘要

构造函数 描述
FileNotFoundException() 构造一个以 null 作为其错误详细消息的 FileNotFoundException。
FileNotFoundException(String s) 使用指定的详细消息构造 FileNotFoundException。

方法总结

从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
从类 java.lang.Throwable 继承的方法
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

构造函数详细信息

FileNotFoundException

public FileNotFoundException()

构造一个以 null 作为其错误详细消息的 FileNotFoundException。

FileNotFoundException

public FileNotFoundException(String s)

使用指定的详细消息构造 FileNotFoundException。 字符串 s 可以稍后通过 java.lang.Throwable 类的 Throwable.getMessage() 方法检索。

参数:

参数名称 参数描述
s 详细信息。
阅读全文
以上是58脚本为你收集整理的 鸿蒙OS FileNotFoundException全部内容。
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。
相关文章
© 2024 58脚本 58jiaoben.com 版权所有 联系我们
桂ICP备12005667号-28 Powered by CMS