private UserProfile login(InputStream in, OutputStream out) throws IOException
{
if( userManager == null )
return UserProfile.DEFAULT_USER_PROFILE;
PrintStream ps = new PrintStream(out);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
ps.print("Username: ");
String username = br.readLine();
ps.print("Password: ");
String password = br.readLine();
UserProfile userProfile = userManager.authenticate(username, password);
if( userProfile != null )
{
ps.println("Login successful");
return userProfile;
}
ps.println("Login failed");
return null;
}