code: public static InputStream getResourceAsStream(String name) {
          InputStream stream = null;
          try {
              stream = Thread.currentThread().getContextClassLoader().getResourceAsStream(name);
          } catch (SecurityException e) {
              LOG.info("Unable to access context classloader, using default. " + e.getMessage());
          }
          if (stream == null) {
              stream = ResourceLoader.class.getResourceAsStream("/" + name);
          }
          return stream;
      }
docs: Load a resource via the thread context classloader. If security permissions don't allow
  this fallback to loading via current classloader.
  
  @param name a resource name
  @return an {@link InputStream} or null if resource is not found