@Service public class DefaultUserInteractionService extends Object implements UserInteractionService
| Modifier and Type | Field and Description |
|---|---|
protected static String |
DEFAULT_NO_SUFFIX_PROMPT |
protected static String |
DEFAULT_YES_SUFFIX_PROMPT |
protected static String |
YES_NO_PROMPT |
| Constructor and Description |
|---|
DefaultUserInteractionService() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkConsoleExistence() |
boolean |
confirmAction(String desc,
String messageToUser,
boolean defaultConfirmation)
Requests yes/no confirmation for an action given its description.
|
void |
setIn(InputStream in) |
void |
setOut(PrintStream out) |
protected static final String YES_NO_PROMPT
protected static final String DEFAULT_NO_SUFFIX_PROMPT
protected static final String DEFAULT_YES_SUFFIX_PROMPT
public boolean confirmAction(String desc, String messageToUser, boolean defaultConfirmation) throws IOException
confirmAction in interface UserInteractionServicedesc - a short description of the action to confirm for logging purposes.messageToUser - the message that should be shown to the user for requesting confirmation.defaultConfirmation - false, if default confirmation answer should be No, true otherwise.IOException - on any I/O related exception like no Console associated to the JVM.public void setIn(InputStream in)
public void setOut(PrintStream out)
protected void checkConsoleExistence()
throws IOException
IOExceptionCopyright © 2022 MuleSoft, Inc.. All rights reserved.