com.ibm.zosconnect.buildtoolkit

Class AARGenerator

  • java.lang.Object
    • com.ibm.zosconnect.buildtoolkit.AARGenerator


  • public class AARGenerator
    extends java.lang.Object
    Generator to generate API archive file(.aar) from API projects
    • Constructor Summary

      Constructors 
      Constructor and Description
      AARGenerator(java.lang.String inputProjectPath, java.lang.String outputDirOrFilePath)
      Creates an instance of AARGenerator.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean createAARFile()
      Creates .aar file.
      java.lang.String getOutputZipFilePath()
      Allows BuildToolkit CLI to get the generated .aar path.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AARGenerator

        public AARGenerator(java.lang.String inputProjectPath,
                            java.lang.String outputDirOrFilePath)
                     throws GenerateAarException
        Creates an instance of AARGenerator. Sets up the projectDir and checks that package.xml exists in the input project. Ensures that the output file is the correct filetype: .aar.
        Parameters:
        inputProjectPath - The input project path.
        outputDirOrFilePath - The output directory or file path. File name must end with .aar.
        Throws:
        GenerateAarException - if package.xml doesn't exist, if the input project doesn't exist or if the output filename isn't a .aar file.
    • Method Detail

      • createAARFile

        public boolean createAARFile()
                              throws GenerateAarException,
                                     java.io.IOException
        Creates .aar file. If a capabilities file exists, writes the apiName and capabilitiesList to a manifest for the .aar file, which is then stored in a manifest file. The manifest file is then added to the outputZipFile. The new package.xml is then added to the outputZipFile. Any other resources in the input project are also added to the outputZipFile. Any object added to the outputZipFile is a ZipEntry.
        Returns:
        true if one or more methods or paths did not have any services associated with them. These methods and paths have been omitted from the API package.
        Throws:
        GenerateAarException - if unmarshalling the package.xml file throws a JAXBException.
        java.io.IOException - if an IOException is thrown.
      • getOutputZipFilePath

        public java.lang.String getOutputZipFilePath()
        Allows BuildToolkit CLI to get the generated .aar path.
        Returns:
        outputZipFile the path to the generated .aar file