Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toURI for local file #122

Open
herriojr opened this issue Oct 28, 2016 · 2 comments
Open

toURI for local file #122

herriojr opened this issue Oct 28, 2016 · 2 comments

Comments

@herriojr
Copy link

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
Copy link

marius-carp commented Jan 23, 2017

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

@herriojr
Copy link
Author

// 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants