2 * put your module comment here
6 package mircoders.media;
18 * Handles realAudio .it manages the ram file.
20 * 03.2002 - reworked Realmedia handling. -mh
22 * @see mir.media.MediaHandlerGeneric
23 * @see mir.media.MirMedia
24 * @author john <john@manifestor.org>, mh <heckmann@hbe.ca>
29 public class MediaHandlerRealAudio extends MediaHandlerAudio implements
32 public void produce (Entity ent, Entity mediaTypeEnt )
33 throws MirMediaException {
35 // first see if the file exists
36 super.produce(ent, mediaTypeEnt);
38 String baseName = ent.getId();
39 String date = ent.getValue("date");
40 String datePath = StringUtil.webdbDate2path(date);
41 String rtspDir = MirConfig.getProp("Producer.RealMedia.Path");
42 String rtspMediaHost = MirConfig.getProp("Producer.RealMedia.Host");
44 String RealMediaPointer = rtspMediaHost+ent.getValue("publish_path");
45 String RealMediaFile = datePath+ent.getId()+".ram";
47 //write an rm (ram?. -mh) file
48 FileUtil.write(super.getStoragePath()+"/"+RealMediaFile,
49 RealMediaPointer.getBytes());
50 } catch (Exception e) {
51 theLog.printError(e.toString());
52 throw new MirMediaException(e.toString());
56 public String getURL(Entity ent, Entity mediaTypeEnt)
58 int size = Integer.parseInt(ent.getValue("size"), 10)/1024;
59 String title = ent.getValue("title")+" - "+mediaTypeEnt.getValue("name")+
61 return StringUtil.createURLLinks(ent.getValue("publish_server")+"/"+
62 ent.getValue("publish_path"), title, imageRoot, getBigIcon());
65 public String getStoragePath() {
66 return MirConfig.getProp("Producer.RealMedia.Path");