I don’t see where the logic to convert the Source[Path, NotUsed] to a Source[ByteString, NotUsed] is in the link you mentioned. Could you be more explicit, please?
If you see this, this will emit a caseclass whenever a file under the given path is created modified or deleted. But if you can write the needed functions you can do something like: Source.repeat(givenDir).delay(tickInterval).map(listAllFilesInDir).map(_.map(file => ByteString(file.getname))) (you can use mapConcat too if you want single names instead of a seq of names)