文件 « 文件 « Java 教程

En
Java 教程
1. 语言基础
2. 数据类型
3. 操作符
4. 流程控制
5. 类定义
6. 开发相关
7. 反射
8. 正则表达式
9. 集合
10. 线
11. 文件
12. 泛型
13. 本土化
14. Swing
15. Swing事件
16. 二维图形
17. SWT
18. SWT 二维图形
19. 网络
20. 数据库
21. Hibernate
22. JPA
23. JSP
24. JSTL
25. Servlet
26. Web服务SOA
27. EJB3
28. Spring
29. PDF
30. 电子邮件
31. 基于J2ME
32. J2EE应用
33. XML
34. 设计模式
35. 日志
36. 安全
37. Apache工具
38. 蚂蚁编译
39. JUnit单元测试
Java
Java 教程 » 文件 » 文件 
11. 2. 文件
11. 2. 1. File类
11. 2. 2. 测试和检查文件对象:文件名和路径
11. 2. 3. 提供URI远程文件
11. 2. 4. isAbsolute(): Returns true if the File object refers to an absolute pathname, and false otherwise.
11. 2. 5. getParent(): Returns the name of the parent directory of the file or directory represented
11. 2. 6. getParentFile(): Returns the parent directory as a File object, or null if this File object does not have a parent.
11. 2. 7. toString(): Returns a String representation of the current File object
11. 2. 8. 存在方法
11. 2. 9. isDirectory(): Returns true if it is an existing directory and false otherwise
11. 2. 10. isFile(): Returns true if it is an existing file and false otherwise
11. 2. 11. isHidden(): Returns true if it is hidden and false otherwise
11. 2. 12. canRead(): Returns true if you are permitted to read the file and false otherwise.
11. 2. 13. canWrite(): Returns true if you are permitted to write to the file and false otherwise.
11. 2. 14. getAbsolutePath(): Returns the absolute path for the directory or file referenced by the current File object
11. 2. 15. getAbsoluteFile(): Returns a File object containing the absolute path for the directory or file referenced by the current File object.
11. 2. 16. list(): Returns a string array containing the children files and directories
11. 2. 17. listFiles(): Returns a File array containing the children files and directories
11. 2. 18. 长度方法
11. 2. 19. 文件的字节数
11. 2. 20. lastModified(): Returns last modified time in milliseconds since midnight on 1st January 1970 GMT
11. 2. 21. renameTo (文件路径) :重命名文件或目录
11. 2. 22. setReadOnly(): Sets the file as read-only and returns true if the operation is successful
11. 2. 23. 过滤一个文件列表
11. 2. 24. mkdir(): Creates a directory
11. 2. 25. mkdirs(): Creates a directory including any parent directories
11. 2. 26. createNewFile(): Creates a new empty file
11. 2. 27. createTempFile(String prefix, String suffix, File directory): a static method that creates a temporary file
11. 2. 28. delete(): delete the file or directory
11. 2. 29. 显示文件类常量和测试的一些方法
11. 2. 30. deleteOnExit(): delete file or directory when the program ends
11. 2. 31. 文件类的增强
11. 2. 32. 创建一个文件并设置为只读。
11. 2. 33. 创建一个文件,并改变其属性为只读
11. 2. 34. 列出所有根目录
11. 2. 35. 获得自由空间
11. 2. 36. 获得可用空间
11. 2. 37. 获得总空间
11. 2. 38. 设置文件属性。
11. 2. 39. 改变文件属性为可写
11. 2. 40. 改变文件属性为只读
11. 2. 41. L从一个文件对象获得正确的UR
11. 2. 42. 获取文件类型图标
11. 2. 43. 获取所有文件扩展名为XML的文件
11. 2. 44. 获取文件扩展名
11. 2. 45. File.getCanonicalFile() converts a filename path to a unique canonical form suitable for comparisons.
www.java2java.com | Contact Us
Copyright 2010 - 2030 Java Source and Support. All rights reserved.
All other trademarks are property of their respective owners.