I already found the resolveLocation() function to convert a logical location to a physical location. Does there also exist a function to convert a physical location to a logical location?
In that case, a location with for example "|project://...", would resolve in "|java+class:///...". I would then be able to use it in the readFileLines() function.