question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow passing classloaders anywhere we use `getResource`

See original GitHub issue

These assume that http4s and application resources come from the same classloader, which is not always the case. We should allow passing a custom classloader instead, defaulting to getClass.getClassLoader.

The change itself is trivial. The main pain here will probably come from MiMa.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rossabakercommented, Sep 3, 2019

I think this is a smart idea.

Maybe #2158 would help, although if it’s just an addition of default parameters, it might not be so bad in current form. Just, as noted, not going to be binary compatible.

Either way, 0.21 is an opportunity to fix this.

0reactions
hamniscommented, Dec 2, 2019

@nigredo-tori yes, I missed that. Should be fixed by #3007

Read more comments on GitHub >

github_iconTop Results From Across the Web

Loading resources using getClass().getResource()
Yes, I am using Eclipse, and it wasn't set up to copy resources. Have fixed that. The class is located in root/bin/<namespace>/MyClass and...
Read more >
What are different ways to load classpath resources in Java?
currentThread().getContextClassLoader().getResource(resourceName): A ClassLoader can be passed (shared) when creating a new thread using Thread.
Read more >
How to Load Resources from Classpath in Java with Example
The answer is by using java.lang.Class' getResource() and getResourceAsStream() method. These methods accept the path of resource as String and return URL and ......
Read more >
Java - Read a file from resources folder - Mkyong.com
In Java, we can use getResourceAsStream or getResource to read a file or multiple files from a resources folder or root of the...
Read more >
Difference Between Class.getResource() and ClassLoader ...
Now, let's see how we can get the resource using a Class instance. We can pass an absolute or relative path when locating...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found