I have a folder structure like below:
- main -- java -- resources -- scalaresources --- commandFiles
and in that folders I have my files
import scala.io.Source object Demo { def main(args: Array[String]): Unit = { val ipfileStream = getClass.getResourceAsStream("/folder/a-words.txt") val readlines = Source.fromInputStream(ipfileStream).getLines readlines.foreach(readlines => println(readlines)) } }