Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.nio.file.DirectoryStream;
- import java.nio.file.Files;
- import java.nio.file.Path;
- import java.nio.file.Paths;
- public class ChildPaths {
- public static void main(String[] args) {
- Path dir = Paths.get(args[0]);
- try (DirectoryStream<Path> dirs = Files.newDirectoryStream(dir)) {
- for (Path path: dirs) {
- if (Files.isRegularFile(path)) {
- System.out.println(path);
- }
- }
- }
- catch (Exception e) {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement