code: public static InputStream toInputStream(String path) throws FileNotFoundException {
          File certFile = new File(path);
          if (!certFile.exists()) {
              // try loading it from the classpath
              URL certResource = CertUtils.class.getClassLoader().getResource(path);
              if (certResource == null) {
                  throw new FileNotFoundException("File at " + path + " not found");
              }
              certFile = new File(certResource.getFile());
          }
          return new FileInputStream(certFile);
      }
docs: Load a keystore from an already opened {@link InputStream}.
  The caller is responsible for closing the resulting stream when it's no longer needed.
  
  @param path path of a key store or certificate.
  @return {@link InputStream} loaded from {@code path}
  @throws FileNotFoundException
  If no file exists at the given {@code path}.