Class DefaultCronJobMediaDataHandler
java.lang.Object
de.hybris.platform.impex.jalo.media.DefaultMediaDataHandler
de.hybris.platform.impex.jalo.cronjob.DefaultCronJobMediaDataHandler
- All Implemented Interfaces:
MediaDataHandler
Extension of
DefaultMediaDataHandler to allow an import of files directly from an set zip media and to export
medias directly to an zip media.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructor for generic instantiation.Constructs an instance of this class with the given CronJob.Constructs an instance of this class with the given CronJob. -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanUp()exportData(Media media) Uses the ZipOutputStream from the ImpExExportCronjob to put the media's rawdata into it.voidimportData(Media destMedia, String path) protected FileunzipMediasMedia(Media sourceMedia, 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 Details
-
ZIP_FILENAME_ENCODINGS
Property that holds zip filename encodings.- See Also:
-
-
Constructor Details
-
DefaultCronJobMediaDataHandler
public DefaultCronJobMediaDataHandler()Empty constructor for generic instantiation. -
DefaultCronJobMediaDataHandler
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
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 Details
-
importData
- Specified by:
importDatain interfaceMediaDataHandler- Overrides:
importDatain classDefaultMediaDataHandler- Throws:
ImpExException
-
exportData
Uses the ZipOutputStream from the ImpExExportCronjob to put the media's rawdata into it.- Specified by:
exportDatain interfaceMediaDataHandler- Overrides:
exportDatain classDefaultMediaDataHandler- See Also:
-
unzipMediasMedia
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
-