edu.pdx.cs399J.grader
Class Submit

java.lang.Object
  extended by edu.pdx.cs399J.grader.Submit

public class Submit
extends Object

This class is used to submit assignments in CS399J. The user specified his or her email address as well as the base directory for his/her source files on the command line. The directory is searched recursively for files ending in .java. Those files are placed in a jar file and emailed to the grader. A confirmation email is sent to the submitter.

More information about the JavaMail API can be found at:

http://java.sun.com/products/javamail

Since:
Fall 2000 (Refactored to use fewer static methods in Spring 2006)
Author:
David Whitlock

Constructor Summary
Submit()
          Creates a new Submit program
 
Method Summary
 void addFile(String fileName)
          Adds the file with the given name to the list of files to be submitted.
static void main(String[] args)
          Parses the command line, finds the source files, prompts the user to verify whether or not the settings are correct, and then sends an email to the Grader.
 void setComment(String comment)
          Sets the comment for this submission
 void setDebug(boolean debug)
          Sets whether or not the progress of the submission should be logged.
 void setProjectName(String projName)
          Sets the name of project being submitted
 void setSaveJar(boolean saveJar)
          Sets whether or not the jar file generated by the submission should be saved.
 void setServerName(String serverName)
          Sets the name of the SMTP server that is used to send emails
 void setUserEmail(String userEmail)
          Sets the email address of the user who is submitting the project
 void setUserId(String userId)
          Sets the id of the user who is submitting the project
 void setUserName(String userName)
          Sets the name of the user who is submitting the project
 boolean submit(boolean verify)
          Submits the project to the grader
 void validate()
          Validates the state of this submission
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Submit

public Submit()
Creates a new Submit program

Method Detail

setServerName

public void setServerName(String serverName)
Sets the name of the SMTP server that is used to send emails


setDebug

public void setDebug(boolean debug)
Sets whether or not the progress of the submission should be logged.


setSaveJar

public void setSaveJar(boolean saveJar)
Sets whether or not the jar file generated by the submission should be saved.


setComment

public void setComment(String comment)
Sets the comment for this submission


setProjectName

public void setProjectName(String projName)
Sets the name of project being submitted


setUserName

public void setUserName(String userName)
Sets the name of the user who is submitting the project


setUserId

public void setUserId(String userId)
Sets the id of the user who is submitting the project


setUserEmail

public void setUserEmail(String userEmail)
Sets the email address of the user who is submitting the project


addFile

public void addFile(String fileName)
Adds the file with the given name to the list of files to be submitted.


validate

public void validate()
Validates the state of this submission

Throws:
IllegalStateException - If any state is incorrect or missing

submit

public boolean submit(boolean verify)
               throws AddressException,
                      IOException,
                      MessagingException
Submits the project to the grader

Parameters:
verify - Should the user be prompted to verify his submission?
Returns:
Whether or not the submission actually occurred
Throws:
IllegalStateException - If no source files were found
AddressException
IOException
MessagingException

main

public static void main(String[] args)
                 throws AddressException,
                        IOException,
                        MessagingException
Parses the command line, finds the source files, prompts the user to verify whether or not the settings are correct, and then sends an email to the Grader.

Throws:
AddressException
IOException
MessagingException


Copyright © 2000-2009 Portland State University. All Rights Reserved.