class ThisClass {
void foo() {
InputStream resourceAsStream = ThisClass.class.getClassLoader().getResourceAsStream(path);
//...
}
}
class ThisClass {
void foo() {
InputStream resourceAsStream = ForeignClass.class.getClassLoader().getResourceAsStream(path);
//...
}
}