Class DefaultMediaDataHandler
java.lang.Object
de.hybris.platform.impex.jalo.media.DefaultMediaDataHandler
- All Implemented Interfaces:
MediaDataHandler
- Direct Known Subclasses:
DefaultCronJobMediaDataHandler
Default implementation of a
The four supported referencing formats are:
MediaDataHandler which supports four different types of data referencing and
importing them to resolved media.The four supported referencing formats are:
- ZIP
zip:c:\demo.zip&demo1.jpg - JAR
jar:ystorefoundationpackage.jalo.YStoreFoundationManager&/media/jeans/demo2.jpgor
jar:/media/jeans/demo2.jpg - URL
http:http://www.company.com/pictures/logo.gif - FILE
file:c:\demo4.jpg - Exploded JAR
/medias/fromjar/demo5.jpg
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanUp()exportData(Media media) Not implemented yet! -- Use de.hybris.platform.cronjob.jalo.impex.DefaultCronJobMediaDataHandlervoidimportData(Media media, String path) protected booleanisAbsolutePath(String path) Checks whether the path starts with a prefix indicating an absolute file path, likefile:c:\demo4.jpgprotected booleanisExplodedJarBasedPath(String path) Checks whether the path starts with a prefix indicating an exploded jar based path, like/medias/fromjar/demo5.jpg.protected booleanisJarBasedPath(String path) Checks whether the path starts with a prefix indicating an jar based path, likejar:ystorefoundationpackage.jalo.YStoreFoundationManager&/media/jeans/demo2.jpg.protected booleanisURLBasedPath(String path) Checks whether the path starts with a prefix indicating an URL based path, likehttp:http://www.company.com/pictures/logo.gif.protected booleanisZipBasedPath(String path) Checks whether the path starts with a prefix indicating an zip based path, likezip:c:\demo.zip&demo1.jpg.protected static StringDeprecated.protected voidsetLegacyMode(boolean legacyMode)
-
Constructor Details
-
DefaultMediaDataHandler
public DefaultMediaDataHandler()
-
-
Method Details
-
importData
- Specified by:
importDatain interfaceMediaDataHandler- Throws:
ImpExException
-
isAbsolutePath
Checks whether the path starts with a prefix indicating an absolute file path, likefile:c:\demo4.jpg -
isJarBasedPath
Checks whether the path starts with a prefix indicating an jar based path, likejar:ystorefoundationpackage.jalo.YStoreFoundationManager&/media/jeans/demo2.jpg.- Parameters:
path- path to check- Returns:
- true if path starts with an jar based path prefix, false otherwise
-
isZipBasedPath
Checks whether the path starts with a prefix indicating an zip based path, likezip:c:\demo.zip&demo1.jpg. -
isURLBasedPath
Checks whether the path starts with a prefix indicating an URL based path, likehttp:http://www.company.com/pictures/logo.gif. -
isExplodedJarBasedPath
Checks whether the path starts with a prefix indicating an exploded jar based path, like/medias/fromjar/demo5.jpg. -
exportData
Not implemented yet! -- Use de.hybris.platform.cronjob.jalo.impex.DefaultCronJobMediaDataHandler- Specified by:
exportDatain interfaceMediaDataHandler- See Also:
-
normalize
Deprecated.since ages - UseFilenameUtils.separatorsToSystem(String)insteadReplaces separator chars within a path with the system specific separators.- Parameters:
path- path which has to be normalized- Returns:
- normalized path with replaced path separators
-
cleanUp
public void cleanUp()- Specified by:
cleanUpin interfaceMediaDataHandler
-
setLegacyMode
protected void setLegacyMode(boolean legacyMode)
-
FilenameUtils.separatorsToSystem(String)instead