/** * Same as {@link #displayFile(String, Class, boolean)} except it passes * false as the final argument. * * @param fileName the simple filename (required) * @param owner the class which owns the file (required) */ public static void displayFile(final String fileName, final Class<?> owner) { displayFile(fileName, owner, false); }
@CliCommand(value = "download status", help = "Provides a summary of the Spring User Agent Analysis (UAA) status and commands") public void uaaStatus() { final PrivacyLevel privacyLevel = uaaService.getPrivacyLevel(); if (privacyLevel == PrivacyLevel.DECLINE_TOU) { MessageDisplayUtils.displayFile("status_declined.txt", UaaCommands.class); } else if (privacyLevel == PrivacyLevel.UNDECIDED_TOU) { MessageDisplayUtils.displayFile("status_undecided.txt", UaaCommands.class); } else { MessageDisplayUtils.displayFile("status_accepted.txt", UaaCommands.class); } }
@CliCommand(value = "download reject terms of use", help = "Rejects the Spring User Agent Analysis (UAA) Terms of Use") public void rejectTou() { uaaService.setPrivacyLevel(PrivacyLevel.DECLINE_TOU); MessageDisplayUtils.displayFile("declined_tou.txt", UaaCommands.class); }
public void onShellStatusChange(final ShellStatus oldStatus, final ShellStatus newStatus) { if (!startupMessageConsidered && newStatus.getStatus() == Status.USER_INPUT) { startupMessageConsidered = true; if (uaaService.getPrivacyLevel() == PrivacyLevel.UNDECIDED_TOU) { // NB: The first line of the text file must contain spaces to // overwrite the roo> prompt on the current line MessageDisplayUtils.displayFile("startup_undecided.txt", ShellListeningUaaRegistrationFacility.class, true); } } } }
@CliCommand(value = "download accept terms of use", help = "Accepts the Spring User Agent Analysis (UAA) Terms of Use") public void acceptTou() { uaaService.setPrivacyLevel(PrivacyLevel.ENABLE_UAA); uaaRegistrationService.flushIfPossible(); MessageDisplayUtils.displayFile("accepted_tou.txt", UaaCommands.class); }