Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
45 views

I cannot get a list of files ending with .pdf, I have tried everything, it lists everything else in the folder, except for the pdf's, what is wrong with this. The program then displays the list in a ...
Roy's user avatar
  • 9
0 votes
1 answer
253 views

Path src = Paths.get("./resources"); Path dst = Paths.get("./trash"); try { DirectoryStream<Path> ds = Files.newDirectoryStream(src); ...
Fugazzie's user avatar
1 vote
1 answer
306 views

I'm writing a backup program using Java and the package NIO. As far as I found, I could do it as in the code example below, i.e. read the folder content list and then for each file I have to do file ...
Sunny's user avatar
  • 103
3 votes
4 answers
3k views

I want to list all files in a directory and subdirectories within that directory that match a file mask. For example "M:\SOURCE\*.doc" while SOURCE may look like this: |-- SOURCE | |-- ...
Jeyson Ardila's user avatar
2 votes
2 answers
829 views

I'd like to use DirectoryStream with Project Reactor to list all the files in a directory. My try is: Path myDir = Paths.get("C:\\Users\\r.dacanal\\Documents\\Reply\\EDA\\logging-consumer\\input"); ...
dacanalr's user avatar
  • 203
2 votes
2 answers
1k views

I would like to show all file extensions in a specific folder and give the total for each extension using DirectoryStream. Now I'm only showing all the files in that folder, but how do I get their ...
Sitjuh's user avatar
  • 117
1 vote
0 answers
151 views

I would like to directly read the files from a subdirectory which is in a zip file. Is there a more convenient way to do it without iterating through all entries? The structure of the zip file is ...
nikolakoco's user avatar
  • 1,403
5 votes
1 answer
5k views

I am trying to read multiple files in a folder using DirectoryStream. There are 10 items altogether. doc_01.txt, doc_02.txt, doc_03.txt, doc_04.txt, doc_05.txt, doc_06.txt, doc_07.txt, doc_08.txt, ...
udon's user avatar
  • 103
0 votes
1 answer
519 views

I'm working on a tool to count archived files from another program. Therefor I'm using the DirectoryStream and filter subdirectories and some files with a simple if-clause (shown below). For the ...
T_Ix's user avatar
  • 66
0 votes
1 answer
1k views

I am trying to use the Java's FileVisitor interface to walk through a list of files and import the contents onto a database. The scenario is to import the csv contents in order. There may be a file ...
dmachop's user avatar
  • 894
0 votes
0 answers
55 views

I feel like I must be missing something. It seems like this should be really easy but I can't seem to find an answer to this question. I'm writing code in Java 8 using both Files.newDirectoryStream()...
backtocoding's user avatar
1 vote
1 answer
3k views

I'm using Java's DirectoryStream to get a list of all the files/subfolders in a directory. However, after going through all the files and folders of the directory, my code then proceeds to go through ...
Brandan B's user avatar
  • 474
2 votes
1 answer
2k views

I want to return a stream of paths (these are files located in a certain directory). My initial approach was this: DirectoryStream getFiles(Path dir) throws IOException { Files.newDirectoryStream(...
Chthonic Project's user avatar
0 votes
0 answers
348 views

I am trying to delete empty folders in java, here is my code: try (DirectoryStream<Path> stream = Files.newDirectoryStream(path)) { for (Path file : stream) { if (file....
jogorm's user avatar
  • 33
0 votes
0 answers
862 views

I had the following code: Path dir = Paths.get("My root dir/Folder1"); try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir, "*.xml")) { for (Path entry : stream) { ...
Skiing-Marmot's user avatar
1 vote
3 answers
3k views

This program deletes all files and folders beneath a given node. *EDIT* I have the following "test" directory structure on drive K: Folder K:\garbage\ f_00000b (file) f_00000f ( " ) f_0000b3 ( " ) ...
DSlomer64's user avatar
  • 4,293
45 votes
9 answers
89k views

I want to list all the FILES within the specified directory and subdirectories within that directory. No directories should be listed. My current code is below. It does not work properly as it only ...
Danny Rancher's user avatar