Object OssLicensesParser

  • All Implemented Interfaces:

    
    public class OssLicensesParser
    
                        

    Parser for the text files generated by the OSS Licenses Gradle Plugin.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • parseAllLicenses

         final static List<ThirdPartyLicense> parseAllLicenses(InputStream thirdPartyLicensesMetadataFile, InputStream thirdPartyLicensesFile)

        Parses all licenses contained in the third_party_licenses_metadata and third_party_licenses files.

        Generally, it is advised to use parseMetadata instead of this method if you only want to display a list of all libraries. Later on, the parseLicense method can be used to display the license content of a specific library. This approach can help save resources.

        Parameters:
        thirdPartyLicensesMetadataFile - Content of the third_party_licenses_metadata file.
        thirdPartyLicensesFile - Content of the third_party_licenses file.
        Returns:

        List of all licenses.

      • parseMetadata

         final static List<ThirdPartyLicenseMetadata> parseMetadata(InputStream thirdPartyLicensesMetadataFile)

        Parses the license metadata contained in the third_party_licenses_metadata file.

        Later on, the parseLicense method can be used to display the license content of a specific library.

        Parameters:
        thirdPartyLicensesMetadataFile - Content of the third_party_licenses_metadata file.
        Returns:

        List of license metadata.

      • parseLicense

         final static ThirdPartyLicense parseLicense(ThirdPartyLicenseMetadata metadata, InputStream thirdPartyLicensesFile)

        Parses a license contained in the third_party_licenses file.

        Parameters:
        metadata - License metadata obtained from the parseMetadata method.
        thirdPartyLicensesFile - Content of the third_party_licenses file.
        Returns:

        The license.