Visitar URL original
Issue with template loading STGroupFile via URL · Issue #200 · antlr/stringtemplate4 · GitHub
Skip to content

Issue with template loading STGroupFile via URL #200

Open

Description

@alexcase52

I have the URL to resource like jar:file://path/to/myjar.jar!/main/main.jar!/com/some/dao/Dao.sql.stg - I've got this using single jar app loader. I pass this URL to corresponding costructor of STGroupFile then internally in load() I see

loadGroupFile("", url.toString());

So url is converted to String via toString() and then internally in loadGroupFile result is passed to new URL(..):

URL f = new URL(fileName);
ANTLRInputStream fs = new ANTLRInputStream(f.openStream(), encoding);

In my case this new URL is of incorrect format and opening stream leads to an exception. I think the issue is in calling URL.toString() -> 'new URL()' instead of obtaining stream directrly from URL via

resource.openConnection().getInputStream()

Thanks

Activity

  1. parrt commented on Nov 9, 2018

    @parrt
    Member

    Hi @alexcase52 is this fixed by #207 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions