Create Resource class for encapsulating file handling.