Preferences/Settings -> Editor -> General -> Console
, check the box next to Override console cycle buffer size
, set to a larger number than 1024 KB.
ID : 20426
viewed : 4
Tags : intellij-ideaconsole-outputintellij-idea
100
80
Couldn't get more votes to close the question so I have to answer it myself.
IDEA_HOME\bin\idea.properties
#----------------------------------------------------------------------- # This option controls console cyclic buffer: keeps the console output size not higher than the specified buffer size (Kb). Older lines are deleted. # In order to disable cycle buffer use idea.cycle.buffer.size=disabled idea.cycle.buffer.size=1024
70
Check out the FileUtils class in Apache Commons - specifically iterateFiles:
Allows iteration over the files in given directory (and optionally its subdirectories).
65
Using org.apache.commons.io.FileUtils
File file = new File("F:/Lines"); Collection<File> files = FileUtils.listFiles(file, null, true); for(File file2 : files){ System.out.println(file2.getName()); }
Use false if you do not want files from sub directories.
51
For Java 7+, there is also https://docs.oracle.com/javase/7/docs/api/java/nio/file/DirectoryStream.html
Example taken from the Javadoc:
List<Path> listSourceFiles(Path dir) throws IOException { List<Path> result = new ArrayList<>(); try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir, "*.{c,h,cpp,hpp,java}")) { for (Path entry: stream) { result.add(entry); } } catch (DirectoryIteratorException ex) { // I/O error encounted during the iteration, the cause is an IOException throw ex.getCause(); } return result; }