<<< Paths and Path classes | Index | Example: Retrieving Information about a Path >>> |
Determine the default file system on the host computer
FileSystem fs = FileSystems.getDefault();
Define a Path using the FileSystem.getPath() method
Path path = fs.getPath( "C:\\example\\Data.txt" );
Note: the specified path can be either absolute or relative
A relative path is a path relative to the current directory
<<< Paths and Path classes | Index | Example: Retrieving Information about a Path >>> |