OSDN Git Service

内部メソッドをの名前を変更し公開メソッドとする
authoryukihane <yukihane.feather@gmail.com>
Mon, 12 Sep 2011 05:28:35 +0000 (14:28 +0900)
committeryukihane <yukihane.feather@gmail.com>
Mon, 12 Sep 2011 05:28:35 +0000 (14:28 +0900)
src/nicobrowser/NicoHttpClient.java

index 43d185b..3383691 100644 (file)
@@ -822,7 +822,7 @@ public class NicoHttpClient {
         } else {
             set.add(DownloadCommentType.COMMENT);
         }
-        return downloadComment(vi, fileName, set, wayback, num);
+        return getCommentFile(vi, fileName, set, wayback, num);
     }
 
     /**
@@ -835,7 +835,7 @@ public class NicoHttpClient {
      * @throws Exception コメント取得失敗.
      */
     public File getCommentFile(VideoInfo vi, String fileName) throws Exception {
-        return downloadComment(vi, fileName, EnumSet.of(DownloadCommentType.COMMENT), null, null);
+        return getCommentFile(vi, fileName, EnumSet.of(DownloadCommentType.COMMENT), null, null);
     }
 
     /**
@@ -846,10 +846,20 @@ public class NicoHttpClient {
      * @throws Exception 投稿者コメント取得失敗.
      */
     public File getTCommentFile(VideoInfo vi, String fileName) throws Exception {
-        return downloadComment(vi, fileName, EnumSet.of(DownloadCommentType.OWNER), null, Integer.valueOf(1000));
+        return getCommentFile(vi, fileName, EnumSet.of(DownloadCommentType.OWNER), null, Integer.valueOf(1000));
     }
 
-    private File downloadComment(VideoInfo vi, String fileName, EnumSet<DownloadCommentType> types,
+    /**
+     * ニコニコ動画サービスからコメントファイルを取得します.
+     * @param vi {@link #getVideoInfo(java.lang.String)}で取得したオブジェクト.
+     * @param fileName 保存するファイル名.
+     * @param types ダウンロード対象とするコメントの種類.
+     * @param wayback 過去ログ情報. 過去ログ取得でなければnull.
+     * @param commentNum 取得するコメント数. 再生時間に応じて取得数を自動決定する場合はnull.
+     * @return コメントファイル.
+     * @throws Exception コメント取得失敗.
+     */
+    public File getCommentFile(VideoInfo vi, String fileName, EnumSet<DownloadCommentType> types,
             WayBackInfo wayback, Integer commentNum) throws Exception {
         HttpResponse response = null;
         BufferedOutputStream bos = null;