InputStream is = xxx.class.getResourceAsStream(filePath);
ClassLoader.getSystemResourceAsStream and this.getClass().getClassLoader().getResourceAsStream()
ClassLoader.getSystemResourceAsStream uses the system ClassLoader (ClassLoader.getSystemClassLoader) to search for the resource.
this.getClass().getClassLoader().getResourceAsStream() uses the same ClassLoader that loaded the class for "this" Object. That ClassLoader might be a child of the system ClassLoader, and thus could have access to resources the system ClassLoader does not have. But since it is a child of the System ClassLoader, it also will ask its parent (System) to help it find resources. So using this method will allow you to find things in that ClassLoader AND in the System ClassLoader.
The search order is defined in the javadoc for ClassLoader.getResource (parent(s) first, then child).
For example, say you were running some code from a Servlet. The System ClassLoader contains whatever you put in CLASSPATH when you started the Web Server, but the servlet class is probably loaded by another ClassLoader that the server created to handle the WebApp's WEB-INF/lib and WEB-INF/classes directories. Things in those directories would be accessible using that WebApp's ClassLoader, but would not be in CLASSPATH - so the System ClassLoader does not know about them.
I'm not sure I explained that well - hope it helps.
So if you want to get properties from a static method, it's better to use: