Class DefaultMediaDataHandler

  • All Implemented Interfaces:
    MediaDataHandler
    Direct Known Subclasses:
    DefaultCronJobMediaDataHandler

    public class DefaultMediaDataHandler
    extends java.lang.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
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void cleanUp()  
      java.lang.String exportData​(Media media)
      Not implemented yet! -- Use de.hybris.platform.cronjob.jalo.impex.DefaultCronJobMediaDataHandler
      void importData​(Media media, java.lang.String path)  
      protected boolean isAbsolutePath​(java.lang.String path)
      Checks whether the path starts with a prefix indicating an absolute file path, like file:c:\demo4.jpg
      protected boolean isExplodedJarBasedPath​(java.lang.String path)
      Checks whether the path starts with a prefix indicating an exploded jar based path, like /medias/fromjar/demo5.jpg.
      protected boolean isJarBasedPath​(java.lang.String path)
      Checks whether the path starts with a prefix indicating an jar based path, like jar:ystorefoundationpackage.jalo.YStoreFoundationManager&/media/jeans/demo2.jpg.
      protected boolean isURLBasedPath​(java.lang.String path)
      Checks whether the path starts with a prefix indicating an URL based path, like http:http://www.company.com/pictures/logo.gif.
      protected boolean isZipBasedPath​(java.lang.String path)
      Checks whether the path starts with a prefix indicating an zip based path, like zip:c:\demo.zip&demo1.jpg.
      protected static java.lang.String normalize​(java.lang.String path)
      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 Detail

      • DefaultMediaDataHandler

        public DefaultMediaDataHandler()
    • Method Detail

      • isAbsolutePath

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

        protected boolean isJarBasedPath​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.String path)
        Checks whether the path starts with a prefix indicating an exploded jar based path, like /medias/fromjar/demo5.jpg.
      • normalize

        @Deprecated(since="ages",
                    forRemoval=false)
        protected static java.lang.String normalize​(java.lang.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
      • setLegacyMode

        protected void setLegacyMode​(boolean legacyMode)