Class DefaultFileGeneratorOperation

    • Constructor Detail

      • DefaultFileGeneratorOperation

        public DefaultFileGeneratorOperation()
    • Method Detail

      • assembleOutputFileName

        public java.lang.String assembleOutputFileName​(ImportCockpitCronJobModel cronJob)
        Description copied from interface: FileGeneratorOperation
        Assembles the name for the output file out of the cron job code and a time stamp, following the pattern: import_package_[cronjob code]_[dd-MM-yyyy-HH-mm-SSS].
        Specified by:
        assembleOutputFileName in interface FileGeneratorOperation
        Returns:
        the assembled output file name (pattern: import_package_[cronjob code]_[dd-MM-yyyy-HH-mm-SSS])
      • createTmpFile

        public java.io.File createTmpFile​(java.lang.String prefix,
                                          java.lang.String filename)
        Description copied from interface: CsvFileOperationHandler
        Creates an empty file in the default temporary-file directory, using the given prefix and filename to generate its name.
        Specified by:
        createTmpFile in interface CsvFileOperationHandler
        Parameters:
        prefix - - The prefix string to be used in generating the file's name; must be at least three characters long.
        filename - - The filename string to be used in generating the file's name; may be null, in which case the prefix ".tmp" will be used.
        Returns:
        - An abstract pathname denoting a newly-created empty file.
      • writeToCsvFile

        public boolean writeToCsvFile​(java.io.File file,
                                      java.lang.String encoding,
                                      java.util.Map<java.lang.Integer,​java.lang.String> data)
        Description copied from interface: CsvFileOperationHandler
        Writes a single line to the writer. See CSVReader.parseLine(String) how the map looks like. The line will be quoted in the textseparator char.
        Map{
        { 0:Integer, Field_1:String },
        { 1:Integer, Field_2:String },
        ...
        { n:Integer, Field_n:String }
        }

        Specified by:
        writeToCsvFile in interface CsvFileOperationHandler
        Parameters:
        file - - An abstract pathname denoting the CSV file to write to.
        encoding - - The encoding to use for the CSV file.
        data - - The line of data which will be written.
        Returns:
        true if no errors occured during the write, false otherwise.