摘要: file.getAbsolutePath(); //获取文件的绝对路径 file.getPath(); //获取路径(构造方法里传什么路径就获取到什么路径) file.getName(); //获取文件或文件夹的名称 file.length(); //获取文件的长度 字节数。 file.lastMo 阅读全文
posted @ 2020-05-27 22:39 一块 阅读(261) 评论(0) 推荐(0) 编辑
摘要: file.exists(); //判断文件是否存在。 file.isFile(); //判断是否是文件。 file.isDirectory(); //判断是否是文件夹。 file.setReadable(false); //将文件设置为不可读的 file.canRead(); //判断文件是否可读。 阅读全文
posted @ 2020-05-27 22:19 一块 阅读(416) 评论(0) 推荐(0) 编辑
摘要: public boolean createNewFile(); //创建文件,如果存在这样的文件,就不创建了,返回值为布尔类型。 public boolean mkdir(); //创建文件夹 如果存在这样的文件夹,就不创建了,返回值为布尔类型。 public boolean mkdirs(); / 阅读全文
posted @ 2020-05-27 22:10 一块 阅读(611) 评论(0) 推荐(0) 编辑