So I'm working on this progject that helps build a website for me and I'm looking to read from a folder (that has files) and write to an html document. I did a little research but I always end up having nothing printed or an error. Let me know if there is a way to do this? This is my project and I've changed the folder location and the output to .txt
public class Project {
@SuppressWarnings("resource")
public static void main(String[] args) throws IOException {
PrintWriter out = new PrintWriter("output.txt");
Files.walk(Paths.get("C:/Location")).forEach(filePath -> {
if (Files.isRegularFile(filePath)) {
out.print(filePath);
}
});
}
}