Class Submission

java.lang.Object
de.hsh.graja.transform.submission.Submission

public class Submission extends Object
  • 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 folder
      submissionNaturalLanguage - 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 disc
      log - hook for comments (@see CommentCollection)
      Returns:
      null, if failed
      Throws:
      SubmissionException
    • write

      public boolean write(Path destDir, ContentLogger log)
      Writes all data to files.
      Parameters:
      destDir - Path to target directory where to unpack the files
      log - hook for comments (@see CommentCollection)
      Returns:
      true on success
    • createComment

      public Content createComment(boolean createIntro, String header, boolean createOutro)