Class MediaProcessor


  • @Service
    public class MediaProcessor
    extends Object
    • Constructor Summary

      Constructors 
      Constructor Description
      MediaProcessor()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static MediaProcessor get()  
      void pasteInternalMedia​(org.silverpeas.core.process.io.file.FileHandler fileHandler, MediaPK fromPK, InternalMedia media, boolean cut)
      Pastes media from a source to a destination.
      void processPhoto​(org.silverpeas.core.process.io.file.FileHandler fileHandler, Photo photo, File image, Watermark watermark)
      Saves uploaded photo file on file system with associated thumbnails and watermarks.
      void processPhoto​(org.silverpeas.core.process.io.file.FileHandler fileHandler, Photo photo, org.silverpeas.core.util.file.FileItem image, Watermark watermark)
      Saves uploaded photo file on file system with associated thumbnails and watermarks.
      void processSound​(org.silverpeas.core.process.io.file.FileHandler fileHandler, Sound sound, File uploadedFile)
      Saves uploaded sound file on file system (In case of drag And Drop upload)
      void processSound​(org.silverpeas.core.process.io.file.FileHandler fileHandler, Sound sound, org.silverpeas.core.util.file.FileItem fileItem)
      Saves uploaded sound file on file system
      void processVideo​(org.silverpeas.core.process.io.file.FileHandler fileHandler, Video video, File uploadedFile)
      Saves uploaded video file on file system (In case of drag And Drop upload)
      void processVideo​(org.silverpeas.core.process.io.file.FileHandler fileHandler, Video video, org.silverpeas.core.util.file.FileItem fileItem)
      Saves uploaded video file on file system and generates a thumbnail for the video.
    • Constructor Detail

      • MediaProcessor

        public MediaProcessor()
    • Method Detail

      • processSound

        public void processSound​(org.silverpeas.core.process.io.file.FileHandler fileHandler,
                                 Sound sound,
                                 org.silverpeas.core.util.file.FileItem fileItem)
                          throws Exception
        Saves uploaded sound file on file system
        Parameters:
        fileHandler - the current session file handler
        sound - the current sound media
        fileItem - the current uploaded sound
        Throws:
        Exception - if the process fails.
      • processSound

        public void processSound​(org.silverpeas.core.process.io.file.FileHandler fileHandler,
                                 Sound sound,
                                 File uploadedFile)
                          throws Exception
        Saves uploaded sound file on file system (In case of drag And Drop upload)
        Parameters:
        fileHandler - the current session file handler
        sound - the current sound media
        uploadedFile - the current uploaded sound
        Throws:
        Exception - if an error occurs while saving the sound file.
      • processVideo

        public void processVideo​(org.silverpeas.core.process.io.file.FileHandler fileHandler,
                                 Video video,
                                 org.silverpeas.core.util.file.FileItem fileItem)
                          throws Exception
        Saves uploaded video file on file system and generates a thumbnail for the video.
        Parameters:
        fileHandler - the current session file handler
        video - the current video media
        fileItem - the current uploaded video
        Throws:
        Exception - if an error occurs while saving the video file.
      • processVideo

        public void processVideo​(org.silverpeas.core.process.io.file.FileHandler fileHandler,
                                 Video video,
                                 File uploadedFile)
                          throws Exception
        Saves uploaded video file on file system (In case of drag And Drop upload)
        Parameters:
        fileHandler - the current session file handler
        video - the current video media
        uploadedFile - the current uploaded video
        Throws:
        Exception - if an error occurs while saving the video file.
      • processPhoto

        public void processPhoto​(org.silverpeas.core.process.io.file.FileHandler fileHandler,
                                 Photo photo,
                                 org.silverpeas.core.util.file.FileItem image,
                                 Watermark watermark)
                          throws Exception
        Saves uploaded photo file on file system with associated thumbnails and watermarks.
        Parameters:
        fileHandler - the current session file handler
        photo - the photo media
        image - the image to register
        watermark - if watermark must be handled, the data are represented by this Watermark instance.
        Throws:
        Exception - on technical error.
      • processPhoto

        public void processPhoto​(org.silverpeas.core.process.io.file.FileHandler fileHandler,
                                 Photo photo,
                                 File image,
                                 Watermark watermark)
                          throws Exception
        Saves uploaded photo file on file system with associated thumbnails and watermarks. (In case of drag And Drop upload)
        Parameters:
        fileHandler - the current session file handler
        photo - the photo media
        image - the image to register
        watermark - if watermark must be handled, the data are represented by this Watermark instance.
        Throws:
        Exception - on technical error.
      • pasteInternalMedia

        public void pasteInternalMedia​(org.silverpeas.core.process.io.file.FileHandler fileHandler,
                                       MediaPK fromPK,
                                       InternalMedia media,
                                       boolean cut)
        Pastes media from a source to a destination.
        Parameters:
        fileHandler - the file handler (space quota management).
        fromPK - the source.
        media - the destination.
        cut - true if it is a cut operation, false if it is a copy one.