@@ -174,7 +174,7 @@ public static boolean isReady() {
174
174
* the board belongs to
175
175
*
176
176
* If the boardID is null there will be no platform examples
177
- *
177
+ *
178
178
* @param boardID
179
179
* @return
180
180
*/
@@ -233,9 +233,9 @@ private static TreeMap<String, IPath> getLibExampleFolders(IPath LibRoot) {
233
233
IPath Lib_examples = LibRoot .append (curLib ).append ("examples" );//$NON-NLS-1$
234
234
IPath Lib_Examples = LibRoot .append (curLib ).append ("Examples" );//$NON-NLS-1$
235
235
if (Lib_examples .toFile ().isDirectory ()) {
236
- examples .putAll (getExampleFolders (curLib , Lib_examples . toFile () ));
236
+ examples .putAll (getExamplesFromFolder (curLib , Lib_examples ));
237
237
} else if (Lib_Examples .toFile ().isDirectory ()) {
238
- examples .putAll (getExampleFolders (curLib , Lib_Examples . toFile () ));
238
+ examples .putAll (getExamplesFromFolder (curLib , Lib_Examples ));
239
239
} else // nothing found directly so maybe this is a version
240
240
// based lib
241
241
{
@@ -246,9 +246,9 @@ private static TreeMap<String, IPath> getLibExampleFolders(IPath LibRoot) {
246
246
Lib_examples = LibRoot .append (curLib ).append (versions [0 ]).append ("examples" );//$NON-NLS-1$
247
247
Lib_Examples = LibRoot .append (curLib ).append (versions [0 ]).append ("Examples" );//$NON-NLS-1$
248
248
if (Lib_examples .toFile ().isDirectory ()) {
249
- examples .putAll (getExampleFolders (curLib , Lib_examples . toFile () ));
249
+ examples .putAll (getExamplesFromFolder (curLib , Lib_examples ));
250
250
} else if (Lib_Examples .toFile ().isDirectory ()) {
251
- examples .putAll (getExampleFolders (curLib , Lib_Examples . toFile () ));
251
+ examples .putAll (getExamplesFromFolder (curLib , Lib_Examples ));
252
252
}
253
253
}
254
254
}
@@ -258,37 +258,13 @@ private static TreeMap<String, IPath> getLibExampleFolders(IPath LibRoot) {
258
258
return examples ;
259
259
}
260
260
261
- /**
262
- * This method adds a folder of examples. There is no search. The provided
263
- * folder is assumed to be a tree where the parents of the leaves are
264
- * assumed examples
265
- *
266
- * @param iPath
267
- * @param pathVarName
268
- */
269
- private static TreeMap <String , IPath > getExampleFolders (String libname , File location ) {
270
- String [] children = location .list ();
271
- TreeMap <String , IPath > examples = new TreeMap <>(String .CASE_INSENSITIVE_ORDER );
272
- if (children == null ) {
273
- // Either dir does not exist or is not a directory
274
- } else {
275
- for (String curFolder : children ) {
276
- IPath LibFolder = new Path (location .toString ()).append (curFolder );
277
- if (LibFolder .toFile ().isDirectory ()) {
278
- examples .put (libname + '-' + curFolder , LibFolder );
279
- }
280
- }
281
- }
282
- return examples ;
283
- }
284
-
285
261
/**
286
262
* This method adds a folder recursively examples. Leaves containing ino
287
263
* files are assumed to be examples
288
264
*
289
265
* @param File
290
266
*/
291
- private static TreeMap <String , IPath > getExamplesFromFolder (String prefix , Path location ) {
267
+ private static TreeMap <String , IPath > getExamplesFromFolder (String prefix , IPath location ) {
292
268
TreeMap <String , IPath > examples = new TreeMap <>(String .CASE_INSENSITIVE_ORDER );
293
269
File [] children = location .toFile ().listFiles ();
294
270
if (children == null ) {
0 commit comments