Search in sources :

Example 1 with LicenseAction

use of com.sun.pkg.client.LicenseAction in project Payara by payara.

the class UpdateCenterHandlers method getLicense.

private static String getLicense(Image img, Fmri fmri) {
    StringBuffer licenseText = new StringBuffer();
    try {
        Manifest manifest = img.getManifest(fmri);
        List<LicenseAction> lla = manifest.getActionsByType(LicenseAction.class);
        for (LicenseAction la : lla) {
            licenseText.append("============= ").append(la.getName()).append(" ================\n");
            licenseText.append(fmri.toString());
            licenseText.append("\n\n");
            licenseText.append(la.getText());
            licenseText.append("\n\n");
        }
        return "" + licenseText;
    } catch (Exception ex) {
        ex.printStackTrace();
    }
    return null;
}
Also used : LicenseAction(com.sun.pkg.client.LicenseAction) Manifest(com.sun.pkg.client.Manifest)

Aggregations

LicenseAction (com.sun.pkg.client.LicenseAction)1 Manifest (com.sun.pkg.client.Manifest)1