OSDN Git Service

ダウンロード失敗をIOExceptionで返すように変更。
[coroid/inqubus.git] / frontend / src / saccubus / converter / filegetter / TcommFileWebGetter.java
1 /*
2  * To change this template, choose Tools | Templates
3  * and open the template in the editor.
4  */
5 package saccubus.converter.filegetter;
6
7 import java.io.File;
8 import java.io.IOException;
9 import saccubus.net.NicoClient;
10 import saccubus.net.TextProgressListener;
11 import saccubus.net.VideoInfo;
12
13 /**
14  *
15  * @author yuki
16  */
17 class TcommFileWebGetter extends FileGetter {
18
19     private final NicoClient client;
20     private final VideoInfo videoInfo;
21
22     protected final NicoClient getClient() {
23         return client;
24     }
25
26     protected final VideoInfo getVideoInfo() {
27         return videoInfo;
28     }
29
30     TcommFileWebGetter(NicoClient client, VideoInfo vi) {
31         this.client = client;
32         this.videoInfo = vi;
33     }
34
35     @Override
36     public File get(File file, TextProgressListener listener) throws IOException {
37         File res = getClient().getTcomment(videoInfo, file, listener);
38         if (res == null) {
39             throw new IOException("\93\8a\8de\8eÒ\83R\83\81\83\93\83g\83t\83@\83C\83\8b\82Ì\83_\83E\83\93\83\8d\81[\83h\82É\8e¸\94s\82µ\82Ü\82µ\82½");
40         }
41         return res;
42     }
43 }