Class MediaUtil
- java.lang.Object
-
- org.silverpeas.components.gallery.MediaUtil
-
public class MediaUtil extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
pasteInternalMedia(org.silverpeas.core.process.io.file.FileHandler fileHandler, MediaPK fromPK, InternalMedia media, boolean cut)
Pastes media from a source to a destination.static 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.static void
processPhoto(org.silverpeas.core.process.io.file.FileHandler fileHandler, Photo photo, org.apache.commons.fileupload.FileItem image, Watermark watermark)
Saves uploaded photo file on file system with associated thumbnails and watermarks.static 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)static void
processSound(org.silverpeas.core.process.io.file.FileHandler fileHandler, Sound sound, org.apache.commons.fileupload.FileItem fileItem)
Saves uploaded sound file on file systemstatic 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)static void
processVideo(org.silverpeas.core.process.io.file.FileHandler fileHandler, Video video, org.apache.commons.fileupload.FileItem fileItem)
Saves uploaded video file on file systemstatic void
setMetaData(org.silverpeas.core.process.io.file.FileHandler fileHandler, Photo photo)
Sets metadata to given instance which represents a photo in memory.
-
-
-
Method Detail
-
processSound
public static void processSound(org.silverpeas.core.process.io.file.FileHandler fileHandler, Sound sound, org.apache.commons.fileupload.FileItem fileItem) throws Exception
Saves uploaded sound file on file system- Parameters:
fileHandler
- the current session file handlersound
- the current sound mediafileItem
- the current uploaded sound- Throws:
Exception
-
processSound
public static 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 handlersound
- the current sound mediauploadedFile
- the current uploaded sound- Throws:
Exception
-
processVideo
public static void processVideo(org.silverpeas.core.process.io.file.FileHandler fileHandler, Video video, org.apache.commons.fileupload.FileItem fileItem) throws Exception
Saves uploaded video file on file system- Parameters:
fileHandler
- the current session file handlervideo
- the current video mediafileItem
- the current uploaded video- Throws:
Exception
-
processVideo
public static 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 handlervideo
- the current video mediauploadedFile
- the current uploaded video- Throws:
Exception
-
processPhoto
public static void processPhoto(org.silverpeas.core.process.io.file.FileHandler fileHandler, Photo photo, org.apache.commons.fileupload.FileItem image, Watermark watermark) throws Exception
Saves uploaded photo file on file system with associated thumbnails and watermarks.
-
processPhoto
public static 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)
-
pasteInternalMedia
public static 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.
-
setMetaData
public static void setMetaData(org.silverpeas.core.process.io.file.FileHandler fileHandler, Photo photo) throws MediaMetadataException
Sets metadata to given instance which represents a photo in memory.- Parameters:
fileHandler
- the file handler (quota space management).photo
- the photo to set.- Throws:
IOException
MediaMetadataException
-
-