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

Issue with template loading STGroupFile via URL #200

Open
alexcase52 opened this issue Apr 25, 2018 · 1 comment
Open

Issue with template loading STGroupFile via URL #200

alexcase52 opened this issue Apr 25, 2018 · 1 comment

Comments

@alexcase52
Copy link

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

@parrt
Copy link
Member

parrt commented Nov 9, 2018

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants