1. Learn
  2. /
  3. Courses
  4. /
  5. Importing Data in Java

Connected

Exercise

Creating basic file readers

You're working as a data analyst at a startup that tracks industry trends. Your team receives CSV files daily with market data that needs to be processed. As the first step in building a data pipeline, you need to create a reliable way to read these files and verify their existence before processing.

The File, Path, Paths, and Files classes have been imported for you.

Instructions

100 XP
  • Create a File object using the file path.
  • Check if the file exists.
  • Get the file size in bytes.
  • Create a Path object from the file path.