Class DefaultFileGeneratorOperation
- java.lang.Object
-
- de.hybris.platform.importcockpit.services.impex.generator.operations.impl.AbstractImpexGeneratorOperation
-
- de.hybris.platform.importcockpit.services.impex.generator.operations.impl.DefaultFileGeneratorOperation
-
- All Implemented Interfaces:
CsvFileOperationHandler,FileGeneratorOperation,ImpexGeneratorOperation
public class DefaultFileGeneratorOperation extends AbstractImpexGeneratorOperation implements FileGeneratorOperation
-
-
Constructor Summary
Constructors Constructor Description DefaultFileGeneratorOperation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringassembleOutputFileName(ImportCockpitCronJobModel cronJob)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].java.io.FilecreateTmpFile(java.lang.String prefix, java.lang.String filename)Creates an empty file in the default temporary-file directory, using the given prefix and filename to generate its name.booleanwriteToCsvFile(java.io.File file, java.lang.String encoding, java.util.Map<java.lang.Integer,java.lang.String> data)Writes a single line to the writer.-
Methods inherited from class de.hybris.platform.importcockpit.services.impex.generator.operations.impl.AbstractImpexGeneratorOperation
appendCatalogVersionDetailsForAttributeReference, appendOwner, apppendTranslatorForProductAttrib, getCatalogTypeService, getCatalogVersionsForMapping, getGeneratedDocIDReference, getHaveUniqueAttributes, getMappingLineService, getMappingService, getVersionForMappingLine, hasMappedSource, hasMappedSources, isCatalogItem, setCatalogTypeService, setMappingLineService, setMappingService
-
-
-
-
Method Detail
-
assembleOutputFileName
public java.lang.String assembleOutputFileName(ImportCockpitCronJobModel cronJob)
Description copied from interface:FileGeneratorOperationAssembles 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:
assembleOutputFileNamein interfaceFileGeneratorOperation- 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:CsvFileOperationHandlerCreates an empty file in the default temporary-file directory, using the given prefix and filename to generate its name.- Specified by:
createTmpFilein interfaceCsvFileOperationHandler- 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 benull, 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:CsvFileOperationHandlerWrites a single line to the writer. SeeCSVReader.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:
writeToCsvFilein interfaceCsvFileOperationHandler- 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.
-
-