Here you can find the source of getFilePathsInFolder(String sensorName)
public static List<String> getFilePathsInFolder(String sensorName)
//package com.java2s; //License from project: Apache License import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.stream.Stream; public class Main { public static List<String> getFilePathsInFolder(String sensorName) { List<String> pathList = new ArrayList<String>(); try (Stream<Path> paths = Files.walk(Paths.get("../../ase_data/atc-rawdata-1/" + sensorName))) { paths.forEach(filePath -> { if (Files.isRegularFile(filePath)) { pathList.add(filePath.toString()); }/*from w w w.ja v a2 s . co m*/ }); Collections.sort(pathList); } catch (IOException e) { e.printStackTrace(); } return pathList; } }