} else {
set.add(DownloadCommentType.COMMENT);
}
- return downloadComment(vi, fileName, set, wayback, num);
+ return getCommentFile(vi, fileName, set, wayback, num);
}
/**
* @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);
}
/**
* @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;