1 10 11 package org.mmbase.applications.media.urlcomposers.omroep; 12 import org.mmbase.applications.media.urlcomposers.RealURLComposer; 13 14 import java.util.Map ; 15 16 23 public class RealSbURLComposer extends RealURLComposer { 24 25 public boolean canCompose() { 26 return provider.getStringValue("host").equals("cgi.omroep.nl") && provider.getStringValue("rootpath").charAt(0) == '%'; 27 } 28 29 30 33 static int addURL(StringBuffer buf, String url) { 34 int length = buf.length(); 35 buf.append(url); 36 int lastSlash = length + url.lastIndexOf('/'); 37 String existingPrefix = buf.substring(lastSlash + 1, lastSlash + 4); 38 if (existingPrefix.equals("sb.") || existingPrefix.equals("bb.")) { buf.delete(lastSlash + 1, lastSlash + 4); 40 } 41 return lastSlash; 42 } 43 44 45 protected String getBandPrefix() { 46 return "sb."; 47 } 48 protected String getBand() { 49 return "smalband"; 50 } 51 public String getGUIIndicator(Map options) { 52 return super.getGUIIndicator(options) + " (" + getBand() +")"; 53 } 54 55 protected StringBuffer getURLBuffer() { 56 StringBuffer buff = new StringBuffer ("rtsp://streams.omroep.nl"); 57 int lastSlash = addURL(buff, source.getStringValue("url")); 58 buff.insert(lastSlash + 1, getBandPrefix()); 59 RealURLComposer.getRMArgs(buff, fragment, info); return buff; 61 } 62 } 63 64 65 | Popular Tags |