X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=source%2Fmir%2Fmedia%2FMediaHandler.java;h=a77ab2e220a47d585240d6bbb469b1f38307dbc2;hb=63e0ee1fb8038eb6d8f0190cf38c3b3ab2727216;hp=33a45f41d74d8994c78da6d02af9271505fa5998;hpb=855ecf8acedb12afbab7a621b2e2c0cf45b2f98f;p=mir.git diff --git a/source/mir/media/MediaHandler.java b/source/mir/media/MediaHandler.java index 33a45f41..a77ab2e2 100755 --- a/source/mir/media/MediaHandler.java +++ b/source/mir/media/MediaHandler.java @@ -30,9 +30,11 @@ package mir.media; import java.io.InputStream; +import java.io.File; import java.util.List; import mir.entity.Entity; +import mir.session.UploadedFile; /** * Interface for Media handling in Mir. All media handlers @@ -79,90 +81,65 @@ import mir.entity.Entity; * ) and just override the things that need to be specific. see MediaHandlerAudio * * @author , the Mir-coders group - * @version $Id: MediaHandler.java,v 1.1.2.2 2003/12/21 13:32:03 zapata Exp $ + * @version $Id: MediaHandler.java,v 1.1.2.3 2004/11/21 22:07:13 zapata Exp $ */ public interface MediaHandler { /** - * Takes the uploaded media data itself, along with the media Entity - * which contains the Media metadata plus the MediaType entity containing - * all the info for the specific media type itself. It's job is store the - * Media data (content) itself, this could be on the local filesystem, in the - * DB or even on a remote host. It then inserts the MetaData in the DB. - * @param InputStream, a stream of the uploaded data. - * @param ent, an Entity holding the media MetaData - * @param mediaType, an Entity holding the media_table entry - * @return boolean, success/fail - * @see mir.entity.Entity + * Store the media content from an {@link UploadedFile} */ - public void store(InputStream in, Entity ent, Entity mediaTypeEnt ) throws MediaExc, MediaFailure; + public void store(UploadedFile anUploadedFile, Entity aMedia, Entity aMediaType) throws MediaExc, MediaFailure; + + /** + * Store the media content from an input stream. + */ + 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; - public void produce(Entity ent, Entity mediaTypeEnt ) 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*). - * @param ent, an Entity holding the media MetaData - * @param mediaType, an Entity holding the media_table entry - * @return java.io.InputStream - * @see mir.entity.Entity */ - public InputStream getMedia (Entity ent, Entity mediaTypeEnt) throws MediaExc, MediaFailure; + 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. - * @param ent, an Entity holding the media MetaData - * @return java.io.InputStream - * @see mir.entity.Entity */ - public InputStream getThumbnail(Entity ent) throws MediaExc, MediaFailure; + public InputStream getThumbnail(Entity aMedia) throws MediaExc, MediaFailure; /** - * - * @param ent - * @return - * @throws MediaExc - * @throws 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. - * @param ent, an Entity holding the media MetaData - * @param mediaTypeEnt, an Entity holding the media_table entry - * @return String, the url. - * @see mir.entity.Entity - * @see mir.misc.StringUtil - */ - public List getURL (Entity ent, Entity mediaTypeEnt) 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. - * @return String, the path. - * @see mir.misc.MirConfig */ public String getStoragePath () 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() * This path is usually defined * in the configuration wich is accessible through the MirConfig * class. - * @return String, the path. - * @see mir.misc.MirConfig */ public String getIconStoragePath () throws MediaExc, MediaFailure; @@ -174,8 +151,6 @@ public interface MediaHandler { * It is usually defined * in the configuration witch is accessible through the MirConfig * class. - * @return String, the base URL to the host. - * @see mir.misc.MirConfig */ public String getPublishHost () throws MediaExc, MediaFailure; @@ -185,8 +160,6 @@ public interface MediaHandler { * It is usually defined * in the configuration wich is accessible through the MirConfig * class. - * @return String, the icon filename. - * @see mir.misc.MirConfig */ public String getBigIconName (); @@ -197,8 +170,6 @@ public interface MediaHandler { * It is usually defined * in the configuration wich is accessible through the MirConfig * class. - * @return String, the icon filename. - * @see mir.misc.MirConfig */ public String getTinyIconName (); @@ -214,7 +185,7 @@ public interface MediaHandler { * media type is. * @return String */ - public String getDescr (Entity mediaTypeEnt); + public String getDescr (Entity aMediaType); }