com.liferay.portlet.documentlibrary.util
Class VideoProcessorImpl

java.lang.Object
  extended by com.liferay.portlet.documentlibrary.util.DLPreviewableProcessor
      extended by com.liferay.portlet.documentlibrary.util.DefaultPreviewableProcessor
          extended by com.liferay.portlet.documentlibrary.util.VideoProcessorImpl
All Implemented Interfaces:
com.liferay.portlet.documentlibrary.util.DLProcessor, com.liferay.portlet.documentlibrary.util.VideoProcessor

public class VideoProcessorImpl
extends com.liferay.portlet.documentlibrary.util.DefaultPreviewableProcessor
implements com.liferay.portlet.documentlibrary.util.VideoProcessor

Author:
Juan González, Sergio González, Mika Koivisto

Field Summary
 
Fields inherited from class com.liferay.portlet.documentlibrary.util.DLPreviewableProcessor
PREVIEW_PATH, PREVIEW_TMP_PATH, REPOSITORY_ID, THUMBNAIL_INDEX_CUSTOM_1, THUMBNAIL_INDEX_CUSTOM_2, THUMBNAIL_INDEX_DEFAULT, THUMBNAIL_PATH, THUMBNAIL_TMP_PATH
 
Fields inherited from interface com.liferay.portlet.documentlibrary.util.VideoProcessor
THUMBNAIL_TYPE
 
Method Summary
 void generateVideo(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
           
static VideoProcessorImpl getInstance()
           
 java.io.InputStream getPreviewAsStream(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
           
 java.io.InputStream getPreviewAsStream(com.liferay.portal.kernel.repository.model.FileVersion fileVersion, java.lang.String type)
           
 long getPreviewFileSize(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
           
 long getPreviewFileSize(com.liferay.portal.kernel.repository.model.FileVersion fileVersion, java.lang.String type)
           
protected  java.lang.String getPreviewType(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
           
protected  java.lang.String[] getPreviewTypes()
           
 java.io.InputStream getThumbnailAsStream(com.liferay.portal.kernel.repository.model.FileVersion fileVersion, int thumbnailIndex)
           
 long getThumbnailFileSize(com.liferay.portal.kernel.repository.model.FileVersion fileVersion, int thumbnailIndex)
           
protected  java.lang.String getThumbnailType(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
           
 java.util.Set<java.lang.String> getVideoMimeTypes()
           
 boolean hasVideo(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
           
 boolean isSupported(java.lang.String mimeType)
           
 boolean isVideoSupported(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
           
 boolean isVideoSupported(java.lang.String mimeType)
           
protected  void storeThumbnailImages(com.liferay.portal.kernel.repository.model.FileVersion fileVersion, java.io.File file)
           
 void trigger(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
           
 
Methods inherited from class com.liferay.portlet.documentlibrary.util.DefaultPreviewableProcessor
cleanUp, cleanUp, doGetPreviewAsStream, doGetPreviewAsStream, doGetPreviewFileSize, doGetPreviewFileSize, getPreviewFilePath, getPreviewFilePath, getPreviewTempFile, getPreviewTempFile, getPreviewTempFileCount, getPreviewTempFilePath, getPreviewTempFilePath, getPreviewType, getPreviewType, getThumbnailFilePath, getThumbnailTempFile, getThumbnailTempFilePath, getThumbnailType
 
Methods inherited from class com.liferay.portlet.documentlibrary.util.DLPreviewableProcessor
addFileToStore, deleteFiles, deleteFiles, deleteFiles, deleteFiles, doGetPreviewAsStream, doGetPreviewAsStream, doGetPreviewFileCount, doGetPreviewFileSize, doGetPreviewFileSize, doGetThumbnailAsStream, doGetThumbnailFileSize, getPathSegment, getPathSegment, getPreviewFilePath, getPreviewFilePath, getPreviewTempFile, getPreviewTempFile, getPreviewTempFileCount, getPreviewTempFilePath, getPreviewTempFilePath, getThumbnailFilePath, getThumbnailTempFile, getThumbnailTempFilePath, hasThumbnail, isCustomThumbnailsEnabled, isSupported, storeThumbnailImages, storeThumbnailmage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static VideoProcessorImpl getInstance()

generateVideo

public void generateVideo(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
                   throws java.lang.Exception
Specified by:
generateVideo in interface com.liferay.portlet.documentlibrary.util.VideoProcessor
Throws:
java.lang.Exception

getPreviewAsStream

public java.io.InputStream getPreviewAsStream(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
                                       throws java.lang.Exception
Specified by:
getPreviewAsStream in interface com.liferay.portlet.documentlibrary.util.VideoProcessor
Throws:
java.lang.Exception

getPreviewAsStream

public java.io.InputStream getPreviewAsStream(com.liferay.portal.kernel.repository.model.FileVersion fileVersion,
                                              java.lang.String type)
                                       throws java.lang.Exception
Specified by:
getPreviewAsStream in interface com.liferay.portlet.documentlibrary.util.VideoProcessor
Throws:
java.lang.Exception

getPreviewFileSize

public long getPreviewFileSize(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
                        throws java.lang.Exception
Specified by:
getPreviewFileSize in interface com.liferay.portlet.documentlibrary.util.VideoProcessor
Throws:
java.lang.Exception

getPreviewFileSize

public long getPreviewFileSize(com.liferay.portal.kernel.repository.model.FileVersion fileVersion,
                               java.lang.String type)
                        throws java.lang.Exception
Specified by:
getPreviewFileSize in interface com.liferay.portlet.documentlibrary.util.VideoProcessor
Throws:
java.lang.Exception

getThumbnailAsStream

public java.io.InputStream getThumbnailAsStream(com.liferay.portal.kernel.repository.model.FileVersion fileVersion,
                                                int thumbnailIndex)
                                         throws java.lang.Exception
Specified by:
getThumbnailAsStream in interface com.liferay.portlet.documentlibrary.util.VideoProcessor
Throws:
java.lang.Exception

getThumbnailFileSize

public long getThumbnailFileSize(com.liferay.portal.kernel.repository.model.FileVersion fileVersion,
                                 int thumbnailIndex)
                          throws java.lang.Exception
Specified by:
getThumbnailFileSize in interface com.liferay.portlet.documentlibrary.util.VideoProcessor
Throws:
java.lang.Exception

getVideoMimeTypes

public java.util.Set<java.lang.String> getVideoMimeTypes()
Specified by:
getVideoMimeTypes in interface com.liferay.portlet.documentlibrary.util.VideoProcessor

hasVideo

public boolean hasVideo(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
Specified by:
hasVideo in interface com.liferay.portlet.documentlibrary.util.VideoProcessor

isVideoSupported

public boolean isVideoSupported(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
Specified by:
isVideoSupported in interface com.liferay.portlet.documentlibrary.util.VideoProcessor

isVideoSupported

public boolean isVideoSupported(java.lang.String mimeType)
Specified by:
isVideoSupported in interface com.liferay.portlet.documentlibrary.util.VideoProcessor

isSupported

public boolean isSupported(java.lang.String mimeType)
Specified by:
isSupported in interface com.liferay.portlet.documentlibrary.util.DLProcessor
Specified by:
isSupported in interface com.liferay.portlet.documentlibrary.util.VideoProcessor

trigger

public void trigger(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
Specified by:
trigger in interface com.liferay.portlet.documentlibrary.util.DLProcessor
Specified by:
trigger in interface com.liferay.portlet.documentlibrary.util.VideoProcessor

getPreviewType

protected java.lang.String getPreviewType(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
Specified by:
getPreviewType in class com.liferay.portlet.documentlibrary.util.DLPreviewableProcessor

getPreviewTypes

protected java.lang.String[] getPreviewTypes()
Overrides:
getPreviewTypes in class com.liferay.portlet.documentlibrary.util.DefaultPreviewableProcessor

getThumbnailType

protected java.lang.String getThumbnailType(com.liferay.portal.kernel.repository.model.FileVersion fileVersion)
Specified by:
getThumbnailType in class com.liferay.portlet.documentlibrary.util.DLPreviewableProcessor

storeThumbnailImages

protected void storeThumbnailImages(com.liferay.portal.kernel.repository.model.FileVersion fileVersion,
                                    java.io.File file)
                             throws java.lang.Exception
Overrides:
storeThumbnailImages in class com.liferay.portlet.documentlibrary.util.DLPreviewableProcessor
Throws:
java.lang.Exception