net.sourceforge.openutils.mgnlmedia.media.utils
Class MediaLoadUtils

java.lang.Object
  extended by net.sourceforge.openutils.mgnlmedia.media.utils.MediaLoadUtils

public class MediaLoadUtils
extends Object

Utility Class that manages loading files into media repository

Version:
$Id: MediaLoadUtils.java 3622 2011-08-21 17:05:47Z fgiust $
Author:
fgiust

Constructor Summary
MediaLoadUtils()
           
 
Method Summary
static info.magnolia.cms.core.Content getOrCreateFullPath(info.magnolia.cms.core.HierarchyManager mgr, String path)
          Get the content node matching required path using hierarchy manager.
static info.magnolia.cms.core.Content loadEntry(InputStream inputStream, String parent, String filename, boolean overwrite)
          Loads a file in the media repository
static info.magnolia.cms.core.Content loadExternalVideo(String videourl, String parent, String filename, boolean overwrite)
          Loads a media linking to an external video.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MediaLoadUtils

public MediaLoadUtils()
Method Detail

loadExternalVideo

public static info.magnolia.cms.core.Content loadExternalVideo(String videourl,
                                                               String parent,
                                                               String filename,
                                                               boolean overwrite)
                                                        throws javax.jcr.RepositoryException,
                                                               IOException
Loads a media linking to an external video.

Parameters:
videourl - absolute video url
parent - media folder
filename - video filename
overwrite - overwrite an exxisting media
Returns:
loaded media
Throws:
javax.jcr.RepositoryException - exception working on media repository
IOException - exception working with file stream

loadEntry

public static info.magnolia.cms.core.Content loadEntry(InputStream inputStream,
                                                       String parent,
                                                       String filename,
                                                       boolean overwrite)
                                                throws javax.jcr.RepositoryException,
                                                       IOException
Loads a file in the media repository

Parameters:
inputStream - file input stream
parent - parent folder node
filename - filename
overwrite - overwrite if already exists?
Returns:
create media node
Throws:
javax.jcr.RepositoryException - exception working on media repository
IOException - exception working with file stream

getOrCreateFullPath

public static info.magnolia.cms.core.Content getOrCreateFullPath(info.magnolia.cms.core.HierarchyManager mgr,
                                                                 String path)
                                                          throws javax.jcr.RepositoryException
Get the content node matching required path using hierarchy manager. If the required path doesn't exist create it.

Parameters:
mgr - hierarchy manager
path - path to get or create
Returns:
content to required path
Throws:
javax.jcr.RepositoryException - exception getting or creating path


Copyright © 2008-2011 Openmind. All Rights Reserved.