Course List: http://www.c-jump.com/bcc/

Paths, files, and directories


  1. Working with directories and files
  2. Paths and Path classes
  3. Using the Path class
  4. Example: Retrieving Information about a Path
  5. Example: Converting a Relative Path to an Absolute One
  6. Example: Checking File Accessibility
  7. Example: Deleting a Path
  8. Example: Determining File Attributes -- size, time
  9. The FileTime class
  10. Example: FileTime comparisons
  11. Static methods of the Files class
  12. Creating directory
  13. File info
  14. Displaying files in a directory
  15. Topics to discuss
  16. I/O operations and Streams
  17. I/O operations and Streams, cont.
  18. Text and Binary files, Character and Binary streams

1. Working with directories and files



2. Paths and Path classes



3. Using the Path class


  1. Determine the default file system on the host computer

    
        FileSystem fs = FileSystems.getDefault();
    
    
  2. 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

     


4. Example: Retrieving Information about a Path



5. Example: Converting a Relative Path to an Absolute One



6. Example: Checking File Accessibility



7. Example: Deleting a Path



8. Example: Determining File Attributes -- size, time



9. The FileTime class



10. Example: FileTime comparisons



11. Static methods of the Files class



12. Creating directory



13. File info



14. Displaying files in a directory



15. Topics to discuss



16. I/O operations and Streams



17. I/O operations and Streams, cont.



18. Text and Binary files, Character and Binary streams