X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=source%2Fmir%2Fmedia%2FMediaHandler.java;fp=source%2Fmir%2Fmedia%2FMediaHandler.java;h=d6eb69957633c71ab13fdaad622d16cc6f7d947e;hb=c9ac8fa71b679f8d967aac901bbef945c13b94c9;hp=0283649a57a71a4901ccadc0cc9b000368255d8d;hpb=d63595f89aaa4b6a524dc0b4af9e0eef888f4c6b;p=mir.git diff --git a/source/mir/media/MediaHandler.java b/source/mir/media/MediaHandler.java index 0283649a..d6eb6995 100755 --- a/source/mir/media/MediaHandler.java +++ b/source/mir/media/MediaHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001, 2002 The Mir-coders group + * Copyright (C) 2005 The Mir-coders group * * This file is part of Mir. * @@ -18,24 +18,19 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * In addition, as a special exception, The Mir-coders gives permission to link - * the code of this program with any library licensed under the Apache Software License, - * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library - * (or with modified versions of the above that use the same license as the above), - * and distribute linked combinations including the two. You must obey the - * GNU General Public License in all respects for all of the code used other than - * the above mentioned libraries. If you modify this file, you may extend this + * the code of this program with any library licensed under the Apache Software License. + * You must obey the GNU General Public License in all respects for all of the code used + * other than the above mentioned libraries. If you modify this file, you may extend this * exception to your version of the file, but you are not obligated to do so. * If you do not wish to do so, delete this exception statement from your version. */ package mir.media; -import java.io.InputStream; -import java.io.File; -import java.util.List; - import mir.entity.Entity; import mir.session.UploadedFile; +import java.io.InputStream; + /** * Interface for Media handling in Mir. All media handlers * must implement this interface. Each specific media type, @@ -64,15 +59,15 @@ import mir.session.UploadedFile; * content-type map for this....). *

* The "mime_type" field is the most important as it does maps the type to Java - * classes (the storage and media_handler name). We call those classes using + * classes (the database and media_handler name). We call those classes using * reflection. This way, once a Handler for a specific media type is implemented * and entered into the media_type table, no other Mir code needs to be modified. *

* The "classname" field is the name of the media handler (e.g MediaHandlerAudio) * we use it to call the MediaHandler methods via reflection. *

- * The "tablename" is the name of the database storage classes (e.g DatabaseImages - * and EntityImages). We use this to fetch/storage the media (meta)data in the db. + * The "tablename" is the name of the database database classes (e.g DatabaseImages + * and EntityImages). We use this to fetch/database the media (meta)data in the db. * , the Mir-coders group + * @version $Id: MediaHandler.java,v 1.3 2007/04/08 21:46:43 idfx Exp $ */ public interface MediaHandler { @@ -95,64 +91,44 @@ public interface MediaHandler { public void store(InputStream anInputStream, Entity aMedia, Entity aMediaType) throws MediaExc, MediaFailure; /** - * Store the media content from a file. - */ - public void store(File aFile, Entity aMedia, Entity aMediaType) throws MediaExc, MediaFailure; - - /** * Perform production related tasks for this media. */ public void produce(Entity aMedia, Entity aMediaType ) throws MediaExc, MediaFailure; /** - * Get's the media data from storage and returns it as an InputStream - * Not very useful for most media types as they are stored in a file, - * but very usefull for ones stored in the DB as it is necessary to get - * it first before making a file out of it (in Producer*). + * Returns the associated media as an input stream */ public InputStream getMedia (Entity aMedia, Entity aMediaType) throws MediaExc, MediaFailure; /** - * Pretty much like get() above. But get's the specific Icon - * representation. useful for media stored in the DB. + * Returns a thumbnail of the associated media as an input stream */ public InputStream getThumbnail(Entity aMedia) throws MediaExc, MediaFailure; - /** * Returns the mime-type of the media's thumbnail */ public String getThumbnailMimeType(Entity aMediaEntity, Entity aMediaType) throws MediaExc, MediaFailure; /** - * gets the final content representation for the media - * in the form of a URL (String) that allows someone to - * download, look at or listen to the media. (HREF, img src - * streaming link, etc..) - * It should use the helper functions in the StringUtil class to - * build URL's safely, eliminating any *illegal* user input. - */ - public List getURL (Entity aMedia, Entity aMediaType) throws MediaExc, MediaFailure; - - /** * Returns the absolute filesystem path to where the media * content should be stored. This path is usually defined * in the configuration wich is accessible through the MirConfig * class. */ - public String getStoragePath () throws MediaExc, MediaFailure; + public String getBaseStoragePath () throws MediaExc, MediaFailure; - /** + /** * Returns the *relative* filesystem path to where the media * icon content should be stored. It is relative to the path - * returned by getStoragePath() + * returned by getBaseStoragePath() * This path is usually defined * in the configuration wich is accessible through the MirConfig * class. */ - public String getIconStoragePath () throws MediaExc, MediaFailure; + public String getBaseIconStoragePath () throws MediaExc, MediaFailure; - /** + /** * Returns the base URL to that the media is accessible from * to the end user. This could be a URL to another host. * This is used in the Metadata stored in the DB and later on @@ -163,7 +139,7 @@ public interface MediaHandler { */ public String getPublishHost () throws MediaExc, MediaFailure; - /** + /** * Returns the file name of the Icon representing the media type. * It is used in the summary view. * It is usually defined @@ -172,7 +148,7 @@ public interface MediaHandler { */ public String getBigIconName (); - /** + /** * Returns the file name of the small Icon representing * the media type. * It is used in the right hand newswire list of the startpage.