code: static void processRoot(final File root, final ProcessedLayers layers, final LayerPathSetter setter) throws IOException {
          final LayersConfig layersConfig = LayersConfig.getLayersConfig(root);
          // Process layers
          final File layersDir = new File(root, layersConfig.getLayersPath());
          if (!layersDir.exists()) {
              if (layersConfig.isConfigured()) {
                  // Bad config from user
                  throw PatchLogger.ROOT_LOGGER.installationNoLayersConfigFound(layersDir.getAbsolutePath());
              }
              // else this isn't a root that has layers and add-ons
          } else {
              // check for a valid layer configuration
              for (final String layer : layersConfig.getLayers()) {
                  File layerDir = new File(layersDir, layer);
                  if (!layerDir.exists()) {
                      if (layersConfig.isConfigured()) {
                          // Bad config from user
                          throw PatchLogger.ROOT_LOGGER.installationMissingLayer(layer, layersDir.getAbsolutePath());
                      }
                      // else this isn't a standard layers and add-ons structure
                      return;
                  }
                  layers.addLayer(layer, layerDir, setter);
              }
          }
          // Finally process the add-ons
          final File addOnsDir = new File(root, layersConfig.getAddOnsPath());
          final File[] addOnsList = addOnsDir.listFiles();
          if (addOnsList != null) {
              for (final File addOn : addOnsList) {
                  layers.addAddOn(addOn.getName(), addOn, setter);
              }
          }
      }
docs: Process a module or bundle root.
  
  @param root   the root
  @param layers the processed layers
  @param setter the bundle or module path setter
  @throws IOException