Search code examples
javascalajardatabricksresource-files

Which jar brings this resource file, in Databricks


I am running a notebook in Databricks, on a cluster that has many libraries that were manually installed.

In code, I am reading a resource file files.txt, which is a resource of a library I just installed.

The files has less lines than expected. I'm assuming that the resource file is also in one of the other installed JARs.

Other than manually downloading the installed JARS, one by one, and examinig them - is there a way to tell which of the installed JARs on the cluster contains the resource file?

I'm reading the file like so:

val stream: InputStream = getClass.getResourceAsStream("/files.txt")
val lines: Iterator[String] = scala.io.Source.fromInputStream( stream ).getLines

Solution

  • getClass().getResource("/files.txt") Will return an URL, this should tell you where the resource is loaded from