java.io Code Samples
- How do I create a temporary file?
- How do I determine if a pathname is a directory?
- How do I check if a file is hidden?
- How do I get the size of a file?
- How do I delete a file?
- How do I read a file into byte array?
- How do I get the list of file system root?
- How do I display file contents in hexadecimal?
- How do I get the extension of a file?
Page 3 of 3 |
Prev
|
Next
How do I determine if a pathname is a directory?
To determine if an abstract pathname is a directory we can use the File.isDirectory() method. Here is an example code.