IfcSpfReader { public static List<String> showFiles(String dir) { List<String> goodFiles = new ArrayList<>(); File folder = new File(dir); File[] listOfFiles = folder.listFiles(); for (int i = 0; i < listOfFiles.length; i++) { if (listOfFiles[i].isFile()) goodFiles.add(listOfFiles[i].getAbsolutePath()); else if (listOfFiles[i].isDirectory()) goodFiles.addAll(showFiles(listOfFiles[i].getAbsolutePath())); } return goodFiles; }  static void main(String[] args); static List<String> showFiles(String dir); static String slurp(InputStream in); @SuppressWarnings("unchecked") void setup(String ifcFileIn); void convert(String ifcFile, String outputFile, String baseURI); void setRemoveDuplicates(boolean val); Map<String, EntityVO> getEntityMap(); Map<String, TypeVO> getTypeMap(); String getOntURI(); static String DEFAULT_PATH; }
@Test public final void testShowFiles() { List<String> fileList = IfcSpfReader.showFiles(getClass().getClassLoader().getResource("showfiles").getFile()); List<String> files = new ArrayList<>(); for (String file : fileList) { files.add(file.substring(file.lastIndexOf(File.separatorChar)+1)); } java.util.Collections.sort(files); StringBuilder sb = new StringBuilder(); for (String s : files) { sb.append(s); sb.append(", "); } Assert.assertEquals( "20160414office_model_CV2_fordesign.ifc, 20160414office_model_CV2_fordesign.ttl, Barcelona_Pavilion.ifc, Barcelona_Pavilion.ttl, ootest.txt, ", sb.toString()); }