All pastes #287774 Raw Edit

Someone

public text v1 · immutable
#287774 ·published 2006-12-21 19:32 UTC
rendered paste body
	private static void list(String directory, BufferedWriter out)
			throws IOException {
		File root = new File(directory);
		if (!root.exists() || !root.isDirectory()) {
			return;
		}
		File files[] = root.listFiles();
		for (File file : files) {
			out.write(file.getName());
			out.newLine();
			if (file.isDirectory())
				list(file.toString(), out);
		}
	}