Here you can find the source of getTables(final List
private static Set<String> getTables(final List<Path> d1) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.nio.file.DirectoryStream; import java.nio.file.Files; import java.nio.file.Path; import java.util.HashSet; import java.util.List; import java.util.Set; public class Main { private static Set<String> getTables(final List<Path> d1) throws IOException { final Set<String> tables = new HashSet<String>(); for (final Path dir : d1) { try (DirectoryStream<Path> listing = Files .newDirectoryStream(dir)) { for (final Path table : listing) { if (Files.isDirectory(table)) { tables.add(table.getFileName().toString()); }/*from ww w .j a v a 2 s. c om*/ } } } return tables; } }