Class ProvisioningUtil


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

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

      • FILE_EXTENSION

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

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

      • 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