/**
  * Uploads a license file. This is restricted to admin users.
  *
  * @param licenseFile the license file.
  */
 @Restrictions({
   @Restrict({"SYSTEM_ADMIN", "SECURITY_ADMIN"}),
   @Restrict({"RESTRICTED_SYSTEM_ADMIN", "RESTRICTED_SECURITY_ADMIN"})
 })
 public static void upload(@Required File licenseFile) {
   if (Validation.hasErrors()) {
     params.flash();
     Validation.keep();
     license();
   }
   try {
     String license = FileUtils.readFileToString(licenseFile);
     if (StringUtils.isBlank(license)) {
       Logger.error("License file is empty");
       Validation.addError("setup.licenseFile", MessagesUtils.get("license.uploadFailed"));
       params.flash();
       Validation.keep();
       license();
     }
     LicenseUtils.updateLicenseText(license);
     index();
   } catch (IOException e) {
     Validation.addError("setup.licenseFile", MessagesUtils.get("license.uploadFailed"));
     Logger.error(e, "Failed to read license file");
     Validation.keep();
     license();
   }
 }
 /**
  * Determines if the product is licensed.
  *
  * @return true if the product is licensed.
  */
 public static boolean isLicensed() {
   if (SetupUtils.isOssBuild()) {
     return true;
   }
   return LicenseUtils.isLicensed(false);
 }