Unable to get lines of a file from given filename

In the getLatestSourceFileVersion we are given a String fileName. We are supposed to return the SourceFileVersion object to calling function. But in order to do this we would need a new FileInfo object, whose constructors take 2 parameters String fileName, and ArrayList/List of Strings called lines. My question is, is there a helper class already there in the project that would help me get all the lines of a specified file if we supply the fileName? Or am I misinterpreting something? How am I supposed to create a FileInfo Object without ‘List lines’ of given ‘fileName’?

hi, you need to store the SourceFileVersion object and filename in your handler class as data members. For now, return the data member SourceFileVersion object in getLatestSourceFileVersion method.

Hey,
Just try to follow up with the TODO instructions carefully everything is clearly mentioned there.

For this task you can clearly see that SourceFileVersionArryListImpl.java file implements SourceFileVersion interface which is inside the SourceFileVersion.java file. The interface contains all neccessary things you require for this task i.e get allLines, getLinesBefore etc etc…

that is where my confusion was. the obvious answer was to return the current object. but i was confused whether that would be considered as latest version or not. thank you.

Hey,

HINT - For getLatestSourceFileVersion create an object of sourceFileVersion

Closing this topic as there is no response since last 12 hours. Please feel free to create a new topic and post this question as a reference link in the description of the new topic.