NET-A-PORTER / scala-uri

Simple scala library for building and parsing URIs
Other
261 stars 33 forks source link

toURI for local file #122

Open herriojr opened 7 years ago

herriojr commented 7 years ago

val uri = Uri.parse("file:///some/path") val converted = uri.toURI // I expect that uri has the scheme set to file, however, the scheme is not set at all // Problem new File(converted) // Throws exception because there is no file scheme

scala version: 2.11 scala-uri version: 0.4.16

marius-carp commented 7 years ago

@herriojr did you fix this? I don't think scala-uri supports parsing local files.

herriojr commented 7 years ago

// These withHost are added because Uri.toString() doesn't properly add back in the scheme val LOCAL_FILE = Uri.parse("file:///some/random/path").withHost("")

^^ that's how I had to do it.