Loading resourcesat 2007-05-12 in Examples by friebe (0 comments) Yesterday we talked about what is the most elegant way to load a resource existing "alongside" a class. With "alongside", we mean:$ ls -a de/thekid/demo/ To load this resource, Alex was using the folllowing: $r= ClassLoader::getDefault()->getResource( As of today, the lang.reflect.Package class was extended to provide this out of the box. The following is now possible: $r= $this->getClass()->getPackage()->getResource('bl-config.ini'); |
|