@@ -6028,6 +6028,7 @@ public XML createXML(String name) {
60286028 }
60296029 }
60306030
6031+
60316032 /**
60326033 * @webref input:files
60336034 * @param filename name of a file in the data folder or a URL.
@@ -6043,6 +6044,7 @@ public XML loadXML(String filename) {
60436044 return loadXML(filename, null);
60446045 }
60456046
6047+
60466048 // version that uses 'options' though there are currently no supported options
60476049 /**
60486050 * @nowebref
@@ -6056,6 +6058,7 @@ public XML loadXML(String filename, String options) {
60566058 }
60576059 }
60586060
6061+
60596062 /**
60606063 * @webref input:files
60616064 * @brief Converts String content to an XML object
@@ -6070,6 +6073,7 @@ public XML parseXML(String xmlString) {
60706073 return parseXML(xmlString, null);
60716074 }
60726075
6076+
60736077 public XML parseXML(String xmlString, String options) {
60746078 try {
60756079 return XML.parse(xmlString, options);
@@ -6079,6 +6083,7 @@ public XML parseXML(String xmlString, String options) {
60796083 }
60806084 }
60816085
6086+
60826087 /**
60836088 * @webref output:files
60846089 * @param xml the XML object to save to disk
@@ -6104,6 +6109,12 @@ public JSONObject loadJSONObject(String filename) {
61046109 }
61056110
61066111
6112+ public JSONArray loadJSONArray(String filename) {
6113+ JSONTokener tokener = new JSONTokener(createReader(filename));
6114+ return new JSONArray(tokener);
6115+ }
6116+
6117+
61076118 /**
61086119 * @webref input:files
61096120 * @see Table
@@ -6884,8 +6895,9 @@ public InputStream createInputRaw(String filename) {
68846895 File file = new File(dataPath(filename));
68856896 if (!file.exists()) {
68866897 // next see if it's just in the sketch folder
6887- file = new File(sketchPath, filename);
6898+ file = sketchFile( filename);
68886899 }
6900+
68896901 if (file.isDirectory()) {
68906902 return null;
68916903 }
0 commit comments