1 10 11 package org.mmbase.applications.media.urlcomposers.omroep; 12 import org.mmbase.applications.media.Format; 13 import org.mmbase.applications.media.urlcomposers.RamURLComposer; 14 import org.mmbase.applications.media.urlcomposers.RealURLComposer; 15 16 import java.util.*; 17 18 19 26 public class CgiSbURLComposer extends RamURLComposer { 27 28 29 protected String getBandPrefix() { 30 return "sb."; 31 } 32 protected String getBand() { 33 return "smalband"; 34 } 35 public String getGUIIndicator(Map options) { 36 return super.getGUIIndicator(options) + " (" + getBand() +")"; 37 } 38 39 40 43 public Format getFormat() { 44 Format format = super.getFormat(); 45 if (format == Format.RM) return Format.RAM; 46 if (format == Format.RA) return Format.RAM; 47 if (format == Format.ASF) return Format.WMP; 48 return format; 49 } 50 51 54 public boolean canCompose() { 55 return provider.getStringValue("host").equals("cgi.omroep.nl") && provider.getStringValue("rootpath").charAt(0) == '%'; 56 } 57 58 59 protected StringBuffer getURLBuffer() { 60 String rootPath = provider.getStringValue("rootpath").substring(1); 61 StringBuffer buff = new StringBuffer (provider.getStringValue("protocol") + "://cgi.omroep.nl" + rootPath); 62 int lastSlash = RealSbURLComposer.addURL(buff, source.getStringValue("url")); 63 buff.insert(lastSlash + 1, getBandPrefix()); 64 RealURLComposer.getRMArgs(buff, fragment, info); return buff; 66 } 67 68 } 69 70 71 | Popular Tags |