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

Feature request: CreateParser.create methods that take a URL, Source, or Stream #96

Open
dc-stripe opened this issue Nov 5, 2019 · 1 comment
Milestone

Comments

@dc-stripe
Copy link

The CreateParser.create() methods in Parser.scala all take a string file path, which doesn't work for a resource file in the jar. Would be nice to have version(s) that took a URL, Source, or Stream.

Library version:
1.0.0

Expected behavior:
that I can call CreateParser[IO].create(resource) with a resource from a jar.

Actual behavior:
Right now they all take a string representing a file path, which gives a FileNotFound exception if you pass in the path of a resource, since it's inside the jar.

Steps to reproduce:

  1. put referers.json into your project's resources
  2. call CreateParser[Id].create(getClass.getResource("/referers.json").getPath)

you get a FileNotFound exception. I can read the file successfully using normal Java file read operations if I use the URL or a stream from getResourceAsStream, but I can't read from the path itself, since it's not a normal file system path.

@chuwy
Copy link

chuwy commented Nov 7, 2019

Sounds like a very good idea. Scheduling.

@chuwy chuwy added this to the Version 1.1.0 milestone Nov 7, 2019
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