Class DefaultMediaDataHandler

java.lang.Object
de.hybris.platform.impex.jalo.media.DefaultMediaDataHandler
All Implemented Interfaces:
MediaDataHandler
Direct Known Subclasses:
DefaultCronJobMediaDataHandler

public class DefaultMediaDataHandler extends Object implements MediaDataHandler
Default implementation of a 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.jpg or
    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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    Not implemented yet! -- Use de.hybris.platform.cronjob.jalo.impex.DefaultCronJobMediaDataHandler
    void
    importData(Media media, String path)
     
    protected boolean
    Checks whether the path starts with a prefix indicating an absolute file path, like file:c:\demo4.jpg
    protected boolean
    Checks whether the path starts with a prefix indicating an exploded jar based path, like /medias/fromjar/demo5.jpg.
    protected boolean
    Checks whether the path starts with a prefix indicating an jar based path, like jar:ystorefoundationpackage.jalo.YStoreFoundationManager&/media/jeans/demo2.jpg.
    protected boolean
    Checks whether the path starts with a prefix indicating an URL based path, like http:http://www.company.com/pictures/logo.gif.
    protected boolean
    Checks whether the path starts with a prefix indicating an zip based path, like zip:c:\demo.zip&demo1.jpg.
    protected static String
    Deprecated.
    since ages - UseFilenameUtils.separatorsToSystem(String) instead
    protected void
    setLegacyMode(boolean legacyMode)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultMediaDataHandler

      public DefaultMediaDataHandler()
  • Method Details

    • importData

      public void importData(Media media, String path) throws ImpExException
      Specified by:
      importData in interface MediaDataHandler
      Throws:
      ImpExException
    • isAbsolutePath

      protected boolean isAbsolutePath(String path)
      Checks whether the path starts with a prefix indicating an absolute file path, like file:c:\demo4.jpg
    • isJarBasedPath

      protected boolean isJarBasedPath(String path)
      Checks whether the path starts with a prefix indicating an jar based path, like jar: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

      protected boolean isZipBasedPath(String path)
      Checks whether the path starts with a prefix indicating an zip based path, like zip:c:\demo.zip&demo1.jpg.
    • isURLBasedPath

      protected boolean isURLBasedPath(String path)
      Checks whether the path starts with a prefix indicating an URL based path, like http:http://www.company.com/pictures/logo.gif.
    • isExplodedJarBasedPath

      protected boolean isExplodedJarBasedPath(String path)
      Checks whether the path starts with a prefix indicating an exploded jar based path, like /medias/fromjar/demo5.jpg.
    • exportData

      public String exportData(Media media)
      Not implemented yet! -- Use de.hybris.platform.cronjob.jalo.impex.DefaultCronJobMediaDataHandler
      Specified by:
      exportData in interface MediaDataHandler
      See Also:
    • normalize

      @Deprecated(since="ages", forRemoval=false) protected static String normalize(String path)
      Deprecated.
      since ages - UseFilenameUtils.separatorsToSystem(String) instead
      Replaces 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:
      cleanUp in interface MediaDataHandler
    • setLegacyMode

      protected void setLegacyMode(boolean legacyMode)