code: public static TomcatServiceBuilder forClassPath(Class<?> clazz, String docBaseOrJarRoot) {
          requireNonNull(clazz, "clazz");
          requireNonNull(docBaseOrJarRoot, "docBaseOrJarRoot");
  
          final ProtectionDomain pd = clazz.getProtectionDomain();
          if (pd == null) {
              throw new IllegalArgumentException(clazz + " does not have a protection domain.");
          }
          final CodeSource cs = pd.getCodeSource();
          if (cs == null) {
              throw new IllegalArgumentException(clazz + " does not have a code source.");
          }
          final URL url = cs.getLocation();
          if (url == null) {
              throw new IllegalArgumentException(clazz + " does not have a location.");
          }
  
          if (!"file".equalsIgnoreCase(url.getProtocol())) {
              throw new IllegalArgumentException(clazz + " is not on a file system: " + url);
          }
  
          File f;
          try {
              f = new File(url.toURI());
          } catch (URISyntaxException ignored) {
              f = new File(url.getPath());
          }
  
          if (TomcatUtil.isZip(f.toPath())) {
              return new TomcatServiceBuilder(f.toPath(), docBaseOrJarRoot);
          }
  
          f = fileSystemDocBase(f, docBaseOrJarRoot);
  
          if (!f.isDirectory()) {
              throw new IllegalArgumentException(f + " is not a directory.");
          }
  
          return forFileSystem(f.toPath());
      }
docs: Creates a new {@link TomcatServiceBuilder} with the web application at the specified document base
  directory inside the JAR/WAR/directory where the specified class is located at.