//File: receive.java //CS 471 - Operating Systems Project //Dennis Pereira, Ely Soto, John Cavalieri //The receive command is a simple acceptance of a message //from another user //the command takes no arguments it is simply 'receive' //all of the messages in the users inbox are displayed //preceded by the user who sent it public class receive extends VMachine { /** Creates new send */ public receive() { } public void run() { try{ User user = sysapi.findUser(owner); //store all messages in a string array String[] msgs = user.getmsgs(); //for each string in the array //i.e. for each message in the inbox for(int i = 0; i < msgs.length; i++) { //print the message to the desired output sysapi.Write(OUT, msgs[i]); } } catch(Exception ex) { System.out.println(ex); } sysapi.Exit(vmh,owner); } }