-----------android training ,Java training , Java Learning Technology blog, look forward to communicating with you! ------------
First: Dark Horse programmer _ Bi Xiangdong _java Basic Video tutorial 20th day -01-io Stream (file overview) One, the file class understanding:
-
- Used to encapsulate a file or folder as an object.
- Easy to manipulate files and folders.
- The file object can be passed as a parameter to the construction method of the Stream object.
- Declaration of the File class: The public class file extends Object implements Serializable, an abstract representation of the comparable<file> file and directory path names.
- Construction method: Public File(String pathname) creates a new instance by converting the given pathname string to an abstract pathname
File
. if the given string is an empty string, the result is an empty abstract path name .
- Constructor: Public File(string parent, string child) creates a new instance based on the parent pathname string and the children pathname string
File
.
- Construction method: Public file(Uri Uri) creates a new file instance by converting the given file: URI to an abstract pathname.
- static field: public static final String separator the system-related default name delimiter, which is represented as a string for convenience. This string contains only a single character.
- Method: Public boolean isfile() tests whether the file represented by this abstract path name is a standard file.
- Method: Public boolean isdirectory() tests whether the file represented by this abstract path name is a directory.
- Method: Public boolean Ishidden() tests whether the file specified by this abstract path name is a hidden file.
- Method: public string GetPath() converts this abstract pathname to a path name string. The resulting string uses
默认名称分隔符
the name in the delimited name sequence.
- Method: Public String getName() returns the name of the file or directory represented by this abstract path name.
--java Basic IO stream of the Dark Horse programmer--Part III