1. Introduction
The getAbsoluteFile() method returns the absolute form of the given File
.
2. Method signature
Parameters:
- method does not take any parameter
Returns
- the absolute abstract pathname indicating the same file or directory as this abstract pathname
Throws
- SecurityException - when we do not have access to the file or directory
3. Examples
3.1. The program that gets the absolute file from /tmp/frontbackend.txt
The output:
4. Conclusion
In this article we presented how to use the File.getAbsoluteFile()
method. The method can be helpful if you create a file using a relative path and want to retrieve information about the parent directory.
{{ 'Comments (%count%)' | trans {count:count} }}
{{ 'Comments are closed.' | trans }}