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
Modifier and TypeClassDescription(package private) static interface
(package private) static class
Nested 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
ConstructorDescriptionSubmit()
Creates a newSubmit
programSubmit
(Submit.CurrentTimeProvider currentTimeProvider) -
Method Summary
Modifier and TypeMethodDescription(package private) void
Adds the file with the given name to the list of files to be submitted.protected boolean
canBeSubmitted
(File file) (package private) static boolean
canFileBeSubmitted
(File file) (package private) boolean
fileExists
(File file) protected String
getZipEntryNameFor
(File file) Returns the name of aFile
relative to the source directory.(package private) static String
getZipEntryNameFor
(String filePath) (package private) String
(package private) boolean
(package private) boolean
isNineDigitStudentId
(String userId) (package private) boolean
looksLikeAnEmailAddress
(String userId) static void
(package private) void
parseCommandLineAndSubmit
(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
setDebug
(boolean debug) Sets whether or not the progress of the submission should be logged.(package private) void
setEmailServerHostName
(String serverName) Sets the name of the SMTP server that is used to send emailsvoid
setEstimatedHours
(Double estimatedHours) (package private) void
setProjectName
(String projName) Sets the name of project being submitted(package private) void
setSendReceipt
(boolean sendReceipt) (package private) void
setStudent
(Student student) boolean
submit
(boolean verify) Submits the project to the grader(package private) static boolean
submittedTestClasses
(Set<File> sourceFiles) protected void
Prints usage information about this program.(package private) void
protected void
warnIfMainProjectClassIsNotSubmitted
(Set<File> sourceFiles) protected void
warnIfTestClassesAreNotSubmitted
(Set<File> sourceFiles) Methods inherited from class edu.pdx.cs410J.grader.EmailSender
newEmailSession, newEmailTo, newInternetAddress, setEmailServerPort
-
Constructor Details
-
Submit
Submit()Creates a newSubmit
program -
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 foundIOException
jakarta.mail.MessagingException
-
canBeSubmitted
-
canFileBeSubmitted
-
fileExists
-
isInMavenProjectDirectory
-
warnIfMainProjectClassIsNotSubmitted
-
warnIfTestClassesAreNotSubmitted
-
submittedTestClasses
-
getZipEntryNameFor
Returns the name of aFile
relative to the source directory. -
getZipEntryNameFor
-
getZipFileTitle
-
usage
Prints usage information about this program. -
main
- Throws:
IOException
jakarta.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:
IOException
jakarta.mail.MessagingException
-
setSendReceipt
-
setEstimatedHours
-