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 1971 2010-02-17 09:50:56Z diego_schivo $
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)
          Load a file in media repository
 
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

loadEntry

public static info.magnolia.cms.core.Content loadEntry(InputStream inputStream,
                                                       String parent,
                                                       String filename,
                                                       boolean overwrite)
                                                throws javax.jcr.RepositoryException,
                                                       IOException
Load a file in 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-2010 Openmind. All Rights Reserved.