class ReplaySettings {

    public ReplaySettings setReplayPath(Path replayPath) throws IOException {
        require("replay path", replayPath);
        replayFiles.clear();
        if (replayPath.toFile().isDirectory()) {
            try (Stream<Path> files = Files.walk(replayPath)) {
                replayFiles.addAll(files.filter(p -> !Files.isDirectory(p)).collect(Collectors.toList()));
            }
        } else if (replayPath.toString().endsWith(SC2_REPLAY_EXTENSION)) {
            replayFiles.add(replayPath.toAbsolutePath());
        }
        return this;
    }

}