Package edu.pdx.cs410J.grader
Class Submit
java.lang.Object
edu.pdx.cs410J.grader.EmailSender
edu.pdx.cs410J.grader.Submit
- Direct Known Subclasses:
SubmitAndroidProject
This class is used to submit assignments in CS410J. 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 that are allowed to be submitted.
Those files are
placed in a zip 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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static interface(package private) static classNested classes/interfaces inherited from class edu.pdx.cs410J.grader.EmailSender
EmailSender.NewEmail -
Field Summary
Fields inherited from class edu.pdx.cs410J.grader.EmailSender
DAVE_EMAIL, serverName, TA_EMAIL -
Constructor Summary
ConstructorsConstructorDescriptionSubmit()Creates a newSubmitprogramSubmit(Submit.CurrentTimeProvider currentTimeProvider) -
Method Summary
Modifier and TypeMethodDescription(package private) voidAdds the file with the given name to the list of files to be submitted.protected booleancanBeSubmitted(File file) (package private) static booleancanFileBeSubmitted(File file) (package private) booleanfileExists(File file) protected StringgetZipEntryNameFor(File file) Returns the name of aFilerelative to the source directory.(package private) static StringgetZipEntryNameFor(String filePath) (package private) String(package private) boolean(package private) booleanisNineDigitStudentId(String userId) (package private) booleanlooksLikeAnEmailAddress(String userId) static void(package private) voidparseCommandLineAndSubmit(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.voidsetDebug(boolean debug) Sets whether or not the progress of the submission should be logged.(package private) voidsetEmailServerHostName(String serverName) Sets the name of the SMTP server that is used to send emailsvoidsetEstimatedHours(Double estimatedHours) (package private) voidsetProjectName(String projName) Sets the name of project being submitted(package private) voidsetSendReceipt(boolean sendReceipt) (package private) voidsetStudent(Student student) booleansubmit(boolean verify) Submits the project to the grader(package private) static booleansubmittedTestClasses(Set<File> sourceFiles) protected voidPrints usage information about this program.(package private) voidprotected voidwarnIfMainProjectClassIsNotSubmitted(Set<File> sourceFiles) protected voidwarnIfTestClassesAreNotSubmitted(Set<File> sourceFiles) Methods inherited from class edu.pdx.cs410J.grader.EmailSender
newEmailSession, newEmailTo, newInternetAddress, setEmailServerPort
-
Constructor Details
-
Submit
Submit()Creates a newSubmitprogram -
Submit
Submit(Submit.CurrentTimeProvider currentTimeProvider)
-
-
Method Details
-
setEmailServerHostName
Sets the name of the SMTP server that is used to send emails -
setDebug
Sets whether or not the progress of the submission should be logged. -
setProjectName
Sets the name of project being submitted -
addFile
Adds the file with the given name to the list of files to be submitted. -
setStudent
-
looksLikeAnEmailAddress
-
isNineDigitStudentId
-
validateProjectName
void validateProjectName() -
submit
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 foundIOExceptionjakarta.mail.MessagingException
-
canBeSubmitted
-
canFileBeSubmitted
-
fileExists
-
isInMavenProjectDirectory
-
warnIfMainProjectClassIsNotSubmitted
-
warnIfTestClassesAreNotSubmitted
-
submittedTestClasses
-
getZipEntryNameFor
Returns the name of aFilerelative to the source directory. -
getZipEntryNameFor
-
getZipFileTitle
-
usage
Prints usage information about this program. -
main
- Throws:
IOExceptionjakarta.mail.MessagingException
-
parseCommandLineAndSubmit
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:
IOExceptionjakarta.mail.MessagingException
-
setSendReceipt
-
setEstimatedHours
-