Trying to use the Filereader.toStringArray(String filename) in a SandBox.
What is the import library for this? Since this isn’t the java.io version, I am assuming this is in org.code somewhere.
Trying to use the Filereader.toStringArray(String filename) in a SandBox.
What is the import library for this? Since this isn’t the java.io version, I am assuming this is in org.code somewhere.
Hi @sheck, thank you for posting this to the forum. After looking around for a bit I unfortunately came up empty. Does import java.io.FileReader;
work? I’ll do some more digging and ask around.
java.io does have a FileReader class, but I think Code.org created their own FileReader with the toXXXXArray methods. So I assume the code.org created FileReader class will be hanging off org.code somewhere. I tried some guesses (like import org.code.io.FileReader) but no joy.
I wish code.org would document all of the libraries the use the JavaLab documentation.
For reference, this is the java.io.FileReader documentation.
FileReader (Java Platform SE 8 ) (oracle.com)
Hi Kevin,
I’m sorry you are having this issue! It is definitely frustrating to not know what code is being run and from where for the FileReader. I wanted to reply back to you that I am looking into the issue, and I believe that you are correct, that Code.org created their own FileReader class. In previous years it was part of the java files included in levels that needed it-- Students used it but did not edit the FileReader class. I believe that this year has the FileReader included as a java file that works in the background. I have reached out for some clarification on this.
Thank you for bringing this issue to light,
Lindsay
Hi, to circle back with info on the FileReader class-
The link I shared above to the previous years lessons does show the code for the FileReader class. The class was moved to be a hidden support class so that students can focus on the learning objectives in the lesson, working with the arrays after the FileReader creates them from the text files. The curriculum team is considering how to make the FileReader class more clear in this unit. Thank you, Kevin, for bringing this up!