FileDocCategorySizeDatePackage
User.javaAPI DocGlassfish v2 API3026Fri May 04 22:25:22 BST 2007com.sun.enterprise.cli.framework

User

public class User extends Object

Fields Summary
private BufferedReader
fromUser
private BufferedWriter
toUser
private String
quit
private String
prompt
Constructors Summary
User(Reader in, Writer out, String quitPrefix, String prompt)

        fromUser = new BufferedReader(in);
        toUser = new BufferedWriter(out);
        quit = quitPrefix;
        this.prompt = prompt;
    
Methods Summary
voidhandleException(java.lang.Exception e)

        toUser.write(e.getMessage());
        toUser.flush();
    
booleanwantsToContinue()
Return false iff the line read from the user starts with the quit character. This is a blocking call, waiting on input from the user

        toUser.write(prompt);
        toUser.newLine();
        toUser.flush();
        return !fromUser.readLine().startsWith(quit);