Created
March 5, 2018 07:52
-
-
Save silverbeak/30b5141747a7d3550755417d4e869fe5 to your computer and use it in GitHub Desktop.
Read resource file using Scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * I do this often enough to merit a Gist, but not often enough to remember by heart. Maybe someone else has the same problem. | |
| * The ".mkstring" part can of course be altered to something else as needed, if you don't want a String | |
| */ | |
| import scala.io.Source | |
| val jsonMsg: String = Source.fromURL(getClass.getResource("/json/test1.json")).mkString |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment