« 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 »
June 29th, 2024 at 08:53
… [Trackback]
[…] There you will find 89858 additional Information on that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]
June 29th, 2024 at 12:16
… [Trackback]
[…] Find More on on that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]
July 1st, 2024 at 18:10
… [Trackback]
[…] Find More here on that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]
July 1st, 2024 at 18:17
… [Trackback]
[…] Read More here to that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]
July 3rd, 2024 at 18:22
… [Trackback]
[…] Here you can find 91158 more Info to that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]
July 7th, 2024 at 18:22
… [Trackback]
[…] Read More here on that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]
July 16th, 2024 at 18:40
… [Trackback]
[…] Here you will find 63786 additional Info on that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]
July 17th, 2024 at 19:03
… [Trackback]
[…] Info on that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]
July 20th, 2024 at 18:09
… [Trackback]
[…] Find More Info here on that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]
July 21st, 2024 at 22:10
… [Trackback]
[…] Find More on on that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]