Object OssLicensesParser
-
- All Implemented Interfaces:
public class OssLicensesParserParser for the text files generated by the OSS Licenses Gradle Plugin.
-
-
Field Summary
Fields Modifier and Type Field Description public final static OssLicensesParserINSTANCE
-
Method Summary
Modifier and Type Method Description final static List<ThirdPartyLicense>parseAllLicenses(InputStream thirdPartyLicensesMetadataFile, InputStream thirdPartyLicensesFile)Parses all licenses contained in the third_party_licenses_metadata and third_party_licenses files. final static List<ThirdPartyLicenseMetadata>parseMetadata(InputStream thirdPartyLicensesMetadataFile)Parses the license metadata contained in the third_party_licenses_metadata file. final static ThirdPartyLicenseparseLicense(ThirdPartyLicenseMetadata metadata, InputStream thirdPartyLicensesFile)Parses a license contained in the third_party_licenses file. -
-
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.
-
-
-
-