com.silverpeas.gallery
Class MediaHelper

java.lang.Object
  extended by com.silverpeas.gallery.MediaHelper

public class MediaHelper
extends Object


Method Summary
static Size getWidthAndHeight(String instanceId, String subDir, String imageName, int baseWidth)
           
static void pasteInternalMedia(org.silverpeas.process.io.file.FileHandler fileHandler, MediaPK fromPK, InternalMedia media, boolean cut)
           
static void processPhoto(org.silverpeas.process.io.file.FileHandler fileHandler, Photo photo, File image, boolean watermark, String watermarkHD, String watermarkOther)
          Saves uploaded photo file on file system with associated thumbnails and watermarks.
static void processPhoto(org.silverpeas.process.io.file.FileHandler fileHandler, Photo photo, org.apache.commons.fileupload.FileItem image, boolean watermark, String watermarkHD, String watermarkOther)
          Saves uploaded photo file on file system with associated thumbnails and watermarks.
static void processSound(org.silverpeas.process.io.file.FileHandler fileHandler, Sound sound, File uploadedFile)
          Saves uploaded sound file on file system (In case of drag And Drop upload)
static void processSound(org.silverpeas.process.io.file.FileHandler fileHandler, Sound sound, org.apache.commons.fileupload.FileItem fileItem)
          Saves uploaded sound file on file system
static void processVideo(org.silverpeas.process.io.file.FileHandler fileHandler, Video video, File uploadedFile)
          Saves uploaded video file on file system (In case of drag And Drop upload)
static void processVideo(org.silverpeas.process.io.file.FileHandler fileHandler, Video video, org.apache.commons.fileupload.FileItem fileItem)
          Saves uploaded video file on file system
static void setMetaData(org.silverpeas.process.io.file.FileHandler fileHandler, Photo photo)
           
static void setMetaData(org.silverpeas.process.io.file.FileHandler fileHandler, Photo photo, String lang)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

processSound

public static void processSound(org.silverpeas.process.io.file.FileHandler fileHandler,
                                Sound sound,
                                org.apache.commons.fileupload.FileItem fileItem)
                         throws Exception
Saves uploaded sound file on file system

Parameters:
fileHandler -
sound - the current sound media
fileItem - the current uploaded sound
Throws:
Exception

processSound

public static void processSound(org.silverpeas.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 -
sound - the current sound media
uploadedFile - the current uploaded sound
Throws:
Exception

processVideo

public static void processVideo(org.silverpeas.process.io.file.FileHandler fileHandler,
                                Video video,
                                org.apache.commons.fileupload.FileItem fileItem)
                         throws Exception
Saves uploaded video file on file system

Parameters:
fileHandler -
video - the current video media
fileItem - the current uploaded video
Throws:
Exception

processVideo

public static void processVideo(org.silverpeas.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 -
video - the current video media
uploadedFile - the current uploaded video
Throws:
Exception

processPhoto

public static void processPhoto(org.silverpeas.process.io.file.FileHandler fileHandler,
                                Photo photo,
                                org.apache.commons.fileupload.FileItem image,
                                boolean watermark,
                                String watermarkHD,
                                String watermarkOther)
                         throws Exception
Saves uploaded photo file on file system with associated thumbnails and watermarks.

Parameters:
fileHandler -
photo -
image -
watermark -
watermarkHD -
watermarkOther -
Throws:
Exception

processPhoto

public static void processPhoto(org.silverpeas.process.io.file.FileHandler fileHandler,
                                Photo photo,
                                File image,
                                boolean watermark,
                                String watermarkHD,
                                String watermarkOther)
                         throws Exception
Saves uploaded photo file on file system with associated thumbnails and watermarks. (In case of drag And Drop upload)

Parameters:
fileHandler -
photo -
image -
watermark -
watermarkHD -
watermarkOther -
Throws:
Exception

setMetaData

public static void setMetaData(org.silverpeas.process.io.file.FileHandler fileHandler,
                               Photo photo)
                        throws IOException,
                               MediaMetadataException
Throws:
IOException
MediaMetadataException

setMetaData

public static void setMetaData(org.silverpeas.process.io.file.FileHandler fileHandler,
                               Photo photo,
                               String lang)
                        throws MediaMetadataException,
                               IOException
Throws:
MediaMetadataException
IOException

getWidthAndHeight

public static Size getWidthAndHeight(String instanceId,
                                     String subDir,
                                     String imageName,
                                     int baseWidth)
                              throws IOException
Throws:
IOException

pasteInternalMedia

public static void pasteInternalMedia(org.silverpeas.process.io.file.FileHandler fileHandler,
                                      MediaPK fromPK,
                                      InternalMedia media,
                                      boolean cut)


Copyright © 2016 Silverpeas. All Rights Reserved.