Class Submission
java.lang.Object
de.hsh.graja.transform.submission.Submission
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateComment
(boolean createIntro, String header, boolean createOutro) static Submission
createSubmission
(File src, String submissionNaturalLanguage, Integer maxSubmissionUnpackSizeKib, String submissionRestrictionsDescription, String submissionRestrictionsInternalDescription, List<FileRestrictionTO> fileRestrictions, ContentLogger log) Create a submission object from a submitted file.boolean
isEmpty()
boolean
write
(Path destDir, ContentLogger log) Writes all data to files.
-
Constructor Details
-
Submission
public Submission()
-
-
Method Details
-
isEmpty
public boolean isEmpty() -
createSubmission
public static Submission createSubmission(File src, String submissionNaturalLanguage, Integer maxSubmissionUnpackSizeKib, String submissionRestrictionsDescription, String submissionRestrictionsInternalDescription, List<FileRestrictionTO> fileRestrictions, ContentLogger log) throws SubmissionException Create a submission object from a submitted file. If the submitted file is a zip file, this method unzips the zip file and loads it into memory. Otherwise the submitted file is treated as a text file submission (usually java source code). When reading the files encodings are guessed and converted to utf8.- Parameters:
srcFile
- The submitted zip file or src foldersubmissionNaturalLanguage
- mandatory parameter, ISO 639-1 code of the language that is assumed as natural language in the submitted files. This will be used to guess the right 8-bit-encoding.maxSubmissionUnpackSizeKib
- maximum size of sumission when unpacked to memory or disclog
- hook for comments (@see CommentCollection)- Returns:
- null, if failed
- Throws:
SubmissionException
-
write
Writes all data to files.- Parameters:
destDir
- Path to target directory where to unpack the fileslog
- hook for comments (@see CommentCollection)- Returns:
- true on success
-
createComment
-