OSDN Git Service

投稿者コメントの保存場所、保存名がおかしい問題の対処
[coroid/inqubus.git] / frontend / src / saccubus / converter / filegetter / FileInstanciator.java
index 043c4e6..cc697a8 100644 (file)
@@ -10,7 +10,7 @@ import saccubus.converter.profile.InputFileSetting;
 import saccubus.net.TextProgressListener;
 
 /**
- * \83_\83E\83\93\83\8d\81[\83h\8f\88\97\9d\82ð\91S\82­\95K\97v\82Æ\82µ\82È\82¢\8fê\8d\87\82Ì\83t\83@\83C\83\8b\83C\83\93\83X\83^\83\93\83X\89»\83N\83\89\83X.
+ * ダウンロード処理を全く必要としない場合のファイルインスタンス化クラス.
  * @author yuki
  */
 public class FileInstanciator {
@@ -68,16 +68,16 @@ public class FileInstanciator {
     }
 
     /**
-     * @return \93®\89æ\82Ì\83^\83C\83g\83\8b.
-     * @throws FileNotFoundException \83r\83f\83I\83^\83C\83g\83\8b\82Ì\8e©\93®\96½\96¼\8e\9e\81A\8eQ\8dl\82Æ\82È\82é\83t\83@\83C\83\8b\82ª\8c©\82Â\82©\82ç\82È\82©\82Á\82½\81B
+     * @return 動画のタイトル.
+     * @throws FileNotFoundException ビデオタイトルの自動命名時、参考となるファイルが見つからなかった。
      */
     public String getVideoTitle() throws FileNotFoundException {
         String fileName = null;
         if (!videoType.isAutoFileName()) {
-            // \93®\89æ\83t\83@\83C\83\8b\96¼\82ð\92¼\90Ú\8ew\92è\82µ\82Ä\82¢\82é\8fê\8d\87\82Í\81A\82»\82Ì\83t\83@\83C\83\8b\96¼\82ð\8aî\82É\83^\83C\83g\83\8b\82ð\8eæ\93¾\82·\82é.
+            // 動画ファイル名を直接指定している場合は、そのファイル名を基にタイトルを取得する.
             fileName = videoType.getInitFile().toString();
         } else {
-            // \8e©\93®\96½\96¼\82Ì\8fê\8d\87\82Í\81A\83f\83B\83\8c\83N\83g\83\8a\93à\82É\82 \82é\83t\83@\83C\83\8b\82©\82ç\83^\83C\83g\83\8b\96¼\82ð\97Þ\90\84\81B
+            // 自動命名の場合は、ディレクトリ内にあるファイルからタイトル名を類推。
             String[] files = videoType.getInitFile().list();
             if (files != null) {
                 for (String file : files) {
@@ -88,7 +88,7 @@ public class FileInstanciator {
                 }
             }
             if (fileName == null) {
-                throw new FileNotFoundException(getVideoIdWithBracket() + "\82Ì\83t\83@\83C\83\8b\82ð\93Á\92è\82Å\82«\82Ü\82¹\82ñ\82Å\82µ\82½\81B");
+                throw new FileNotFoundException(getVideoIdWithBracket() + "のファイルを特定できませんでした。");
             }
         }
 
@@ -98,23 +98,23 @@ public class FileInstanciator {
     }
 
     /**
-     * \93®\89æ\83t\83@\83C\83\8b\82ð\8eæ\93¾\82µ\82Ü\82·.
-     * @param listener \90i\92»\92Ê\92m\82ð\8eó\82¯\8eæ\82é\82½\82ß\82Ì\83\8a\83X\83i.
-     * @return \93®\89æ\83t\83@\83C\83\8b.
-     * @throws IOException \93®\89æ\83t\83@\83C\83\8b\82ª\91\8dÝ\82µ\82È\82¢, \8eæ\93¾\82É\8e¸\94s\82µ\82½.
+     * 動画ファイルを取得します.
+     * @param listener 進捗通知を受け取るためのリスナ.
+     * @return 動画ファイル.
+     * @throws IOException 動画ファイルが存在しない, 取得に失敗した.
      */
     public final File getVideoFile(TextProgressListener listener) throws IOException {
         File file = new FileLocator(videoType.isAutoFileName(), videoType.getInitFile(), getVideoIdWithBracket(),
-                getVideoTitle(), ".flv").getFile();
+                getVideoTitle(), ".flv", ".mp4", ".swf").getFile();
         file = videoFileGetter.get(file, listener);
         return file;
     }
 
     /**
-     * \83R\83\81\83\93\83g\83t\83@\83C\83\8b\82ð\8eæ\93¾\82µ\82Ü\82·.
-     * @param listener \90i\92»\92Ê\92m\82ð\8eó\82¯\8eæ\82é\82½\82ß\82Ì\83\8a\83X\83i.
-     * @return \83R\83\81\83\93\83g\83t\83@\83C\83\8b.
-     * @throws IOException \83R\83\81\83\93\83g\83t\83@\83C\83\8b\82ª\91\8dÝ\82µ\82È\82¢, \8eæ\93¾\82É\8e¸\94s\82µ\82½.
+     * コメントファイルを取得します.
+     * @param listener 進捗通知を受け取るためのリスナ.
+     * @return コメントファイル.
+     * @throws IOException コメントファイルが存在しない, 取得に失敗した.
      */
     public final File getCommentFile(TextProgressListener listener) throws IOException {
         File file = new FileLocator(commentType.isAutoFileName(), commentType.getInitFile(), getVideoIdWithBracket(),
@@ -124,10 +124,10 @@ public class FileInstanciator {
     }
 
     /**
-     * \93\8a\8de\8eÒ\83R\83\81\83\93\83g\83t\83@\83C\83\8b\82ð\8eæ\93¾\82µ\82Ü\82·.
-     * @param listener \90i\92»\92Ê\92m\82ð\8eó\82¯\8eæ\82é\82½\82ß\82Ì\83\8a\83X\83i.
-     * @return \93\8a\8de\8eÒ\83R\83\81\83\93\83g\83t\83@\83C\83\8b.
-     * @throws IOException \83R\83\81\83\93\83g\83t\83@\83C\83\8b\82ª\91\8dÝ\82µ\82È\82¢, \8eæ\93¾\82É\8e¸\94s\82µ\82½.
+     * 投稿者コメントファイルを取得します.
+     * @param listener 進捗通知を受け取るためのリスナ.
+     * @return 投稿者コメントファイル.
+     * @throws IOException コメントファイルが存在しない, 取得に失敗した.
      */
     public final File getTcommFile(TextProgressListener listener) throws IOException {
         File file = new FileLocator(tcommType.isAutoFileName(), tcommType.getInitFile(), getVideoIdWithBracket(),
@@ -147,7 +147,7 @@ public class FileInstanciator {
         private final File initFile;
 
         /**
-         * \83t\83@\83C\83\8b\82ð\83C\83\93\83X\83^\83\93\83X\89»\82·\82é\95û\96@\82ð\8ew\92è\82·\82é\83N\83\89\83X.
+         * ファイルをインスタンス化する方法を指定するクラス.
          */
         public InstanciationType(InputFileSetting fileSetting) {
             this.download = fileSetting.isDownload();