File 关键词

getParent() 获取父路径

getAbsoluteFile 获取绝对路径

length()  获得文件的字节数

getName() 获取路径中最后部分的名字

getPath() 获取整体路径。

isDirectory 是否是目录。

exists  目标是否存在。

delete 删除。

mkdirs 建立一个新的子目录。

createNewFile 创建新文件。

listFiles() 文件列表。

猜你喜欢

转载自www.cnblogs.com/lxr521/p/10591735.html