public Collection<File> getUploadedFiles() throws IOException {
        if (uploadDirectory == null) {
            return Collections.emptyList();
        }

        FileAdderVisitor visitor = new FileAdderVisitor();
        Files.walkFileTree(uploadDirectory, visitor);

        return Collections.unmodifiableCollection(visitor.getContainedFiles());
    }
@Test
    void testDirectoryScan() throws IOException {
        Path rootDir = Paths.get("root");
        Path rootFile = rootDir.resolve("rootFile");
        Path subDir = rootDir.resolve("sub");
        Path subFile = subDir.resolve("subFile");

        Path tmp = temporaryFolder;
        Files.createDirectory(tmp.resolve(rootDir));
        Files.createDirectory(tmp.resolve(subDir));
        Files.createFile(tmp.resolve(rootFile));
        Files.createFile(tmp.resolve(subFile));

        try (FileUploads fileUploads = new FileUploads(tmp.resolve(rootDir))) {
            Collection<Path> detectedFiles =
                    fileUploads.getUploadedFiles().stream()
                            .map(File::toPath)
                            .collect(Collectors.toList());

            assertThat(detectedFiles).hasSize(2);
            assertThat(detectedFiles).contains(tmp.resolve(rootFile));
            assertThat(detectedFiles).contains(tmp.resolve(subFile));
        }
    }