Class DefaultCronJobMediaDataHandler
- java.lang.Object
-
- de.hybris.platform.impex.jalo.media.DefaultMediaDataHandler
-
- de.hybris.platform.impex.jalo.cronjob.DefaultCronJobMediaDataHandler
-
- All Implemented Interfaces:
MediaDataHandler
public class DefaultCronJobMediaDataHandler extends DefaultMediaDataHandler
Extension ofDefaultMediaDataHandlerto allow an import of files directly from an set zip media and to export medias directly to an zip media.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringZIP_FILENAME_ENCODINGSProperty that holds zip filename encodings.
-
Constructor Summary
Constructors Constructor Description DefaultCronJobMediaDataHandler()Empty constructor for generic instantiation.DefaultCronJobMediaDataHandler(ImpExExportCronJob cronJob)Constructs an instance of this class with the given CronJob.DefaultCronJobMediaDataHandler(ImpExImportCronJob cronJob)Constructs an instance of this class with the given CronJob.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanUp()java.lang.StringexportData(Media media)Uses the ZipOutputStream from the ImpExExportCronjob to put the media's rawdata into it.voidimportData(Media destMedia, java.lang.String path)protected java.io.FileunzipMediasMedia(Media sourceMedia, java.lang.String normalizedLocation)Extracts the given media to a temporary directory.-
Methods inherited from class de.hybris.platform.impex.jalo.media.DefaultMediaDataHandler
isAbsolutePath, isExplodedJarBasedPath, isJarBasedPath, isURLBasedPath, isZipBasedPath, normalize, setLegacyMode
-
-
-
-
Field Detail
-
ZIP_FILENAME_ENCODINGS
public static final java.lang.String ZIP_FILENAME_ENCODINGS
Property that holds zip filename encodings.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DefaultCronJobMediaDataHandler
public DefaultCronJobMediaDataHandler()
Empty constructor for generic instantiation.
-
DefaultCronJobMediaDataHandler
public DefaultCronJobMediaDataHandler(ImpExImportCronJob cronJob)
Constructs an instance of this class with the given CronJob. The CronJob contains a resource media optional which is used during theimportData(Media, String)to import files from it. If the zip media is null, the import methods ofDefaultMediaDataHandlerare used.- Parameters:
cronJob- cronjob holding a resource media optional
-
DefaultCronJobMediaDataHandler
public DefaultCronJobMediaDataHandler(ImpExExportCronJob cronJob)
Constructs an instance of this class with the given CronJob. The CronJob contains a ZipOutputStream which is used during theexportData(Media)to put the Media's rawdata in it. If the ZipOutputStream is null, no raw-data will be exported- Parameters:
cronJob- cronjob holding the export zip media
-
-
Method Detail
-
importData
public void importData(Media destMedia, java.lang.String path) throws ImpExException
- Specified by:
importDatain interfaceMediaDataHandler- Overrides:
importDatain classDefaultMediaDataHandler- Throws:
ImpExException
-
exportData
public java.lang.String exportData(Media media)
Uses the ZipOutputStream from the ImpExExportCronjob to put the media's rawdata into it.- Specified by:
exportDatain interfaceMediaDataHandler- Overrides:
exportDatain classDefaultMediaDataHandler- See Also:
MediaDataHandler.exportData(de.hybris.platform.jalo.media.Media)
-
unzipMediasMedia
protected java.io.File unzipMediasMedia(Media sourceMedia, java.lang.String normalizedLocation)
Extracts the given media to a temporary directory. Only files located at given location will be extracted from zip, where the given location will be trimmed from there new path.- Parameters:
sourceMedia- media containing the source zip file and which will be extractednormalizedLocation- location within given zip from where the extraction will be performed
-
cleanUp
public void cleanUp()
- Specified by:
cleanUpin interfaceMediaDataHandler- Overrides:
cleanUpin classDefaultMediaDataHandler
-
-