OSDN Git Service

過去ログ取得時点をConverterコンストラクタ引数からProfileに移動
[coroid/inqubus.git] / frontend / src / yukihane / Util.java
1 /* $Id$ */
2 package yukihane;
3
4 /**
5  * nicobrowser.util.Utilより, 必要なものをピックアップしたクラス.
6  * @author yuki
7  */
8 public class Util {
9
10     /**
11      * Content-Type から拡張子を決定する.
12      * @param contentType Content-Type文字列.
13      * @return 推測される拡張子.
14      */
15     public static String getExtention(String contentType) {
16         if ("video/flv".equals(contentType) || "video/x-flv".equals(contentType)) {
17             return "flv";
18         } else if ("video/mp4".equals(contentType)) {
19             return "mp4";
20         } else if ("application/x-shockwave-flash".equals(contentType)) {
21             return "swf";
22         }
23         return contentType.split("/")[1];
24     }
25 }