Class ProvisioningUtil

java.lang.Object
io.wcm.devops.conga.plugins.sling.util.ProvisioningUtil

public final class ProvisioningUtil extends Object
Helper for handling provisioning file format.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Provisioning file extension (this is currently not standardized)
    static final String
    Alternative "txt" file extension for provisioning files, which is currently used officially.
  • Method Summary

    Modifier and Type
    Method
    Description
    static List<io.wcm.devops.conga.generator.spi.context.FileContext>
    generateOsgiConfigurations(org.apache.sling.provisioning.model.Model model, File dir, io.wcm.devops.conga.generator.spi.context.PostProcessorContext context)
    Generate OSGi configuration for all feature and run modes.
    static org.apache.sling.provisioning.model.Model
    getModel(io.wcm.devops.conga.generator.spi.context.FileContext file)
    Parse provisioning file to model
    static boolean
    isProvisioningFile(io.wcm.devops.conga.generator.spi.context.FileContext file)
    Check if given file is a sling provisioning file.
    static <R> List<R>
    visitOsgiConfigurations(org.apache.sling.provisioning.model.Model model, ConfigConsumer<R> consumer)
    Visits OSGi configuration for all feature and run modes.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • FILE_EXTENSION

      public static final String FILE_EXTENSION
      Provisioning file extension (this is currently not standardized)
      See Also:
    • TEXT_FILE_EXTENSION

      public static final String TEXT_FILE_EXTENSION
      Alternative "txt" file extension for provisioning files, which is currently used officially.
      See Also:
  • Method Details

    • isProvisioningFile

      public static boolean isProvisioningFile(io.wcm.devops.conga.generator.spi.context.FileContext file)
      Check if given file is a sling provisioning file.
      Parameters:
      file - File
      Returns:
      true if it seems to be so
    • getModel

      public static org.apache.sling.provisioning.model.Model getModel(io.wcm.devops.conga.generator.spi.context.FileContext file) throws IOException
      Parse provisioning file to model
      Parameters:
      file - File
      Returns:
      Model
      Throws:
      IOException - I/O exception
    • visitOsgiConfigurations

      public static <R> List<R> visitOsgiConfigurations(org.apache.sling.provisioning.model.Model model, ConfigConsumer<R> consumer) throws IOException
      Visits OSGi configuration for all feature and run modes.
      Type Parameters:
      R - Result type
      Parameters:
      model - Provisioning Model
      consumer - Configuration consumer
      Returns:
      List of non-null results
      Throws:
      IOException - I/O exception
    • generateOsgiConfigurations

      public static List<io.wcm.devops.conga.generator.spi.context.FileContext> generateOsgiConfigurations(org.apache.sling.provisioning.model.Model model, File dir, io.wcm.devops.conga.generator.spi.context.PostProcessorContext context) throws IOException
      Generate OSGi configuration for all feature and run modes.
      Parameters:
      model - Provisioning Model
      dir - Target directory
      context - Post processor context
      Returns:
      Generated files
      Throws:
      IOException - I/O exception