score:7
Accepted answer
As you can see from the error log, the path you're providing is being converted to a URL (for example SPACE
becomes %20
). You should use the fromURL
method Source.fromURL(Source.getClass().getResource("/lesson4/test.txt"))
score:2
You have spaces in your path converted to encoded from the URL.
Source: stackoverflow.com
Related Query
- Simple file read with Scala does not work
- Why does pattern matching in Scala not work with variables?
- IntelliJ IDEA Hotkey for comment does not work with Scala
- 7.toBinayString does not work in scala REPL, but with val k=7 it works
- Command `timeout` does not work with Scala - why?
- Simple file read with Scala ARM library
- Scala does not read file from resources folder
- Why does Scala implicit conversion work here with two args but not with one?
- Scala type inference does not work with type bounds, unless the type is specified explicitly
- JsonIgnore for Scala method with default parameters does not work as expected
- Suggest imports does not work with Scala IDE (and sbt)
- How to read a text file with mixed encodings in Scala or Java?
- How do I read a large CSV file with Scala Stream class?
- Eclipse, Android, Scala made easy but still does not work
- scala string.split does not work
- Intellij: SBT-based Scala project does not build with Java 9
- scala 2.10.2 calling a 'macro method' with generic type not work
- Does it make any sense to use pattern matching in Scala with really simple cases?
- Why does overloading polymorphic methods with different upper bounds not compile in Scala
- Does maven-shade-plugin work with scala classes?
- Why scala does not unify this type lambda with underlying type?
- Simple use of Scala collections from Java not compiling with 2.11
- Scala REPL does not work on Ubuntu
- Scala sbt assembly jar does not work (class implementation not found) but code works when through IntelliJ
- scala project does not work in intellij
- Scala Stdin.readLine() does not seem to work as expected
- Why I get "Application does not take parameters" using JSON Read with Play framework 2.3?
- Method taking implicit CanBuildFrom does not work with eta-expansion?
- 2 Extension Methods with the same name in different classes do not work in Scala 3?
- Renaming a .scala file in Scala IDE does not rename the class
More Query from same tag
- Scala, case object with productIterator-able fields?
- Why does Scala take less time to read a file if it's done multiple times?
- How to design a partial function that accepts the all domain, but dependent on some state?
- Convert Json with variable keys
- Scalatra test restful JSON object
- List counter with foldLeft
- How to create a singleton reference in playframework
- Scala Do While Loop Not Ending
- Scalate ResourceNotFoundException in Scalatra
- How to create two sequence out of one comparing one custom object with another in that sequence?
- List of every n-th item in a given list
- Control not reaching to Specific Location in Scala Nested Map
- scala.MatchError: String Extraction using regular expression
- Debugging Scala Services In Intellij
- How to group by on a field inside an array of an array of records?
- Scala .zip with higher-kinded types, weird behaviour
- Spark specify multiple logical condition in where clause of spark dataframe
- Right not working with for comprehension Scala
- Variable length argument list with default argument?
- IntelliJ built a project with 2 errors on udf function - No TypeTag available for Option[Seq[Testclass]]
- Scala: subclass a Java class with multiple constructors?
- Casting cassandra timestamp column as timeuuid
- 500 error page doesn't show up
- Generate pgp files during package
- Transpose dataframe withe many columns
- How to group by on epoch timestame field in Scala spark
- How to add an Ivy SSH repository to SBT resolvers?
- Scala merge between 2 lists base on condition
- Scala's Mutable Queue isn't mutable when in a Map
- Writing complex/nested JSON Writes in Scala PlayFramework