@Test public void testTemplateReplace() throws Exception { String mediaPattern1 = "$RepresentationID$/media-$Time$.mp4"; String mediaPattern2 = "$RepresentationID$/media-$Number$.mp4"; String mediaPattern3 = "$RepresentationID$/media-$Number%04d$.mp4"; String mediaPattern1Replaced = ManifestHelper.templateReplace(mediaPattern1, "abc", 213, 4354, 5463); Assert.assertEquals("abc/media-5463.mp4", mediaPattern1Replaced); String mediaPattern2Replaced = ManifestHelper.templateReplace(mediaPattern2, "abc", 213, 4354, 5463); Assert.assertEquals("abc/media-213.mp4", mediaPattern2Replaced); String mediaPattern3Replaced = ManifestHelper.templateReplace(mediaPattern3, "abc", 213, 4354, 5463); Assert.assertEquals("abc/media-0213.mp4", mediaPattern3Replaced); }
public static String templateReplace(String input_string, String representation_id, long number, long bandwidth, long time) { String rv = input_string; rv = rv.replace("$$", "$"); rv = replace(REPRESENTATION_PATTERN.matcher(rv), rv, representation_id); rv = replace(NUMBER_PATTERN.matcher(rv), rv, number); rv = replace(TIME_PATTERN.matcher(rv), rv, time); rv = replace(BANDWIDTH_PATTERN.matcher(rv), rv, bandwidth); return rv; }
ManifestHelper { public static String templateReplace(String input_string, String representation_id, long number, long bandwidth, long time) { String rv = input_string; rv = rv.replace("$$", "$"); rv = replace(REPRESENTATION_PATTERN.matcher(rv), rv, representation_id); rv = replace(NUMBER_PATTERN.matcher(rv), rv, number); rv = replace(TIME_PATTERN.matcher(rv), rv, time); rv = replace(BANDWIDTH_PATTERN.matcher(rv), rv, bandwidth); return rv; } }
ManifestHelper { public static String templateReplace(String input_string, String representation_id, long number, long bandwidth, long time) { String rv = input_string; rv = rv.replace("$$", "$"); rv = replace(REPRESENTATION_PATTERN.matcher(rv), rv, representation_id); rv = replace(NUMBER_PATTERN.matcher(rv), rv, number); rv = replace(TIME_PATTERN.matcher(rv), rv, time); rv = replace(BANDWIDTH_PATTERN.matcher(rv), rv, bandwidth); return rv; }  }
ManifestHelper { public static String templateReplace(String input_string, String representation_id, long number, long bandwidth, long time) { String rv = input_string; rv = rv.replace("$$", "$"); rv = replace(REPRESENTATION_PATTERN.matcher(rv), rv, representation_id); rv = replace(NUMBER_PATTERN.matcher(rv), rv, number); rv = replace(TIME_PATTERN.matcher(rv), rv, time); rv = replace(BANDWIDTH_PATTERN.matcher(rv), rv, bandwidth); return rv; }  static String convertFramerate(double vrate); static String calculateIndexRange(Container isoFile); static String templateReplace(String input_string, String representation_id, long number, long bandwidth, long time); }
ManifestHelper { public static String templateReplace(String input_string, String representation_id, long number, long bandwidth, long time) { String rv = input_string; rv = rv.replace("$$", "$"); rv = replace(REPRESENTATION_PATTERN.matcher(rv), rv, representation_id); rv = replace(NUMBER_PATTERN.matcher(rv), rv, number); rv = replace(TIME_PATTERN.matcher(rv), rv, time); rv = replace(BANDWIDTH_PATTERN.matcher(rv), rv, bandwidth); return rv; }  static String convertFramerate(double vrate); static String calculateIndexRange(Container isoFile); static String templateReplace(String input_string, String representation_id, long number, long bandwidth, long time);  }