Read the content of a given source.
Read the content of a given source.
Mind that this function is NOT thread safe when reading from jar files.
ToDo: extract & refactor the common parts in 'read' and 'readResources'
The source to read.
The charset the file content is encoded in.
A pair consisting of a file path and the file content.
Read all files with a given extension in a given path, recursively through all subdirectories.
Read all files with a given extension in a given path, recursively through all subdirectories.
Mind that this function is NOT thread safe when reading from jar files.
http://www.uofr.net/~greg/java/get-resource-listing.html http://alvinalexander.com/source-code/scala/create-list-all-files-beneath-directory-scala http://stackoverflow.com/questions/31406471/get-resource-file-from-dependency-in-sbt http://alvinalexander.com/blog/post/java/read-text-file-from-jar-file
The path that we want to read all files from recursively.
The extension of the files that we want to read.
The charset the file contents are encoded in.
Later on, we want to combine Path objects, but that only works when their filesystems are compatible, so we convert paths that come out of a jar archive to the default filesystem.
Later on, we want to combine Path objects, but that only works when their filesystems are compatible, so we convert paths that come out of a jar archive to the default filesystem.
See: http://stackoverflow.com/questions/22611919/why-do-i-get-providermismatchexception-when-i-try-to-relativize-a-path-agains
The path to convert to the default filesystem.
The converted path.
Created by peter on 12/04/17.