From: yukihane Date: Mon, 12 Sep 2011 05:28:35 +0000 (+0900) Subject: 内部メソッドをの名前を変更し公開メソッドとする X-Git-Tag: test20110916_inqubus2.b.0~3 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=f627dc190cf5fc9af27e2a1cf86d004857f49e99;p=coroid%2FNicoBrowser.git 内部メソッドをの名前を変更し公開メソッドとする --- diff --git a/src/nicobrowser/NicoHttpClient.java b/src/nicobrowser/NicoHttpClient.java index 43d185b..3383691 100644 --- a/src/nicobrowser/NicoHttpClient.java +++ b/src/nicobrowser/NicoHttpClient.java @@ -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 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 types, WayBackInfo wayback, Integer commentNum) throws Exception { HttpResponse response = null; BufferedOutputStream bos = null;