« Epson DS-30 on Ubuntu Linux | Home | git-strip-above »
Getting files from sources in Scala
By admin | February 14, 2021
// Java-based ways getClass.getResource("/html/myfile.html") println(Source.fromInputStream(getClass.getResourceAsStream("/html/myfile.html")).mkString) // Scala-native way // Note: NO LEADING SLASH println(Source.fromResource("html/myfile.html").getLines.toList)
If you found this article helpful or interesting, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful and interesting articles!
Topics: Code | 10 Comments »
March 26th, 2025 at 09:36
… [Trackback]
[…] There you can find 81968 more Information on that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]
March 27th, 2025 at 13:58
… [Trackback]
[…] Find More Info here on that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]
March 27th, 2025 at 19:25
… [Trackback]
[…] Info on that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]
March 30th, 2025 at 01:22
… [Trackback]
[…] Read More Information here to that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]
April 2nd, 2025 at 07:42
… [Trackback]
[…] Read More here to that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]
April 2nd, 2025 at 23:02
… [Trackback]
[…] Info on that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]
April 3rd, 2025 at 18:29
… [Trackback]
[…] Find More Info here on that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]
April 3rd, 2025 at 19:03
… [Trackback]
[…] Find More Info here on that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]
April 13th, 2025 at 19:46
… [Trackback]
[…] Info to that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]
April 16th, 2025 at 18:18
… [Trackback]
[…] Info to that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]