/**
 * A protocal for Java to interact with an IMAP server
 *
 * @author Ben Kaiser
 * @author Josh Vickery
 * @version 1.0 of October 1999
 */

public class Network {
    /** connect to the server, at the specified port */
    public void  connect(String server, int port) 
    // throw an exception if a connection can not be established
	throws ConnectionException
    {
	// well written code
    } // connect(String, int)
    
    /* attempt to login to the server, with designated username and password */
    public void login(String username, String passwd)
    // throw an exception if it is a bad user pass combo
	throws LoginException
    {
	// even better code
    } // login(String, Sting)
    
    /** list the folders in the account, in the form of an array*/
    public String[] listFolders()
    {
	return new String[0];	// STUB
	// more code
    } // listFolders

    /**delete a specific folder and its contenets.  throws
       FolderException.*/
    public void deleteFolder(String folderName)
    // throw an exception if the folder can not be deleted
	throws  FolderException
    {
	// stunning code
    } // deleteFolder(String folderName)

    /**create a specific folder and its contents*/
    public void createFolder(String folderName)
    // throw an exception if an invalid folder name is used
	throws  FolderException
    {
	// more neat code 
    } // createFolder(String folderName)

    
    /** get the contents of a folder, returns an array of headers, throws
	FolderException.*/
    public String[] getFolderContents(String folderName)
    throws FolderException
    {
	return new String[0];	// STUB
	// code
    } //  getFolderContents(String folderName)

    /**renames a folder, throws FolderException*/ 
    public void renameFolder(String folderName, String newFolderName)
    throws FolderException
    {
	// code written after 10 cups of coffee
    } // renameFolder(String folderName, String newFolderName)

    /**Sets the active folder throws FolderException */
    public void setFolder(String folderName)
    throws FolderException
    {
	// and 2 liters of jolt
    } // setFolder(String folderName)
   
    /**closes the imap socket.*/
    public void bye()
    {
	// code
    } // bye()

    /**Deletes a message, throws MessageException*/
    public void deleteMessage(String MessageName)
    throws MessageException
    {
	// stuff
    } // deleteMessage(String MessageName)
    
    
    /**Get the contents of a message, returns a string, throws
       MessageException*/
    public String getMessage(String MessageName)
	throws MessageException
    {
	return "Hi there!";	// STUB
	// stuff
    } //getMessage(String MessageName)

    /**file a message in an existing folder, throws
       MessageException, and FolderException*/
    public void fileMessage(String MessageName, String FileName)
    throws MessageException, FolderException
    {
	// stuff
    } // fileMessage(String MessageName, String FileName)

    
    /** establish a connection to the given SMTP server with the given server
	name and port number, throws ConnectionException*/
    public void openConnection(String serverName, int port)
	throws ConnectionException
    {
	// more stuff
    }//  openConnection(String serverName, int port)

    /** sends message using smtp throws MessageException*/
    public void sendMessage(MailMessage message)
	throws MessageException
    {
	// last stuff
    } //  sendMessage(MailMessage message)
} // class Network

