File类
构造
File file = new File(“filename”);
File file = new File(“/”,“filename”);
.
方法
getName() // 获取文件名
getPath() // 获取路径
getAbsolutePath() //获取绝对路径
getParent() //获取父文件夹名
renameTo(File name) //更改成功返回true
以下返回Boolean类型
exists() //文件存在
canWrite() //可写?
canRead() //可读?
isFile() // 对象是文件
isDirectory() // 对象是目录
isAbsolute() //对象是绝对路径
.
lastModified() // 获取文件最后修改时间
length() // 获取文件长度
delete() // 删除文件
mkdir()
mkdirs() // 可以一次生成多层次的子目录
Stringp[] list()// 列出符合模式的文件名



