/* $Id$ */ package yukihane; /** * nicobrowser.util.Utilより, 必要なものをピックアップしたクラス. * @author yuki */ public class Util { /** * Content-Type から拡張子を決定する. * @param contentType Content-Type文字列. * @return 推測される拡張子. */ public static String getExtention(String contentType) { if ("video/flv".equals(contentType) || "video/x-flv".equals(contentType)) { return "flv"; } else if ("video/mp4".equals(contentType)) { return "mp4"; } else if ("application/x-shockwave-flash".equals(contentType)) { return "swf"; } return contentType.split("/")[1]; } }