« 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 | 9 Comments »
March 15th, 2024 at 19:32
… [Trackback]
[…] Find More on to that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]
April 2nd, 2024 at 18:32
… [Trackback]
[…] Information to that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]
April 4th, 2024 at 14:01
… [Trackback]
[…] Find More to that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]
April 6th, 2024 at 18:11
… [Trackback]
[…] Here you can find 82389 more Info to that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]
April 11th, 2024 at 18:26
… [Trackback]
[…] Read More Information here on that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]
April 17th, 2024 at 18:14
… [Trackback]
[…] There you can find 58156 additional Information to that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]
April 19th, 2024 at 20:49
… [Trackback]
[…] Read More Info here to that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]
April 20th, 2024 at 09:57
… [Trackback]
[…] Find More to that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]
April 20th, 2024 at 11:28
… [Trackback]
[…] Find More Info here to that Topic: compdigitec.com/labs/2021/02/14/getting-files-from-sources-in-scala/ […]