Skip to content

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

@dc-stripe

Description

@dc-stripe

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions