OSDN Git Service

ソースコードをUTF-8化
[coroid/inqubus.git] / frontend / src / saccubus / converter / filegetter / WebFileInstanciator.java
index 7e93092..a2cd758 100644 (file)
@@ -9,7 +9,7 @@ import saccubus.net.NicoClient;
 import saccubus.net.VideoInfo;
 
 /**
- * \93®\89æ\83t\83@\83C\83\8b\83R\83\81\83\93\83g\83t\83@\83C\83\8b\82È\82Ç\95K\97v\82È\83t\83@\83C\83\8b\82Ì\82¤\82¿, 1\82Â\82Å\82à\83_\83E\83\93\83\8d\81[\83h\8f\88\97\9d\82ð\95K\97v\82Æ\82·\82é\8fê\8d\87\82Ì\83C\83\93\83X\83^\83\93\83X\89»\83N\83\89\83X.
+ * 動画ファイル, コメントファイルなど必要なファイルのうち, 1つでもダウンロード処理を必要とする場合のインスタンス化クラス.
  * @author yuki
  */
 public class WebFileInstanciator extends FileInstanciator {
@@ -28,7 +28,7 @@ public class WebFileInstanciator extends FileInstanciator {
         super(videoType, commentType, tcommType, tag);
 
         if (li.getMail() == null || li.getPass() == null || li.getMail().equals("") || li.getPass().equals("")) {
-            throw new IllegalArgumentException("\83\81\81[\83\8b\83A\83h\83\8c\83X\82©\83p\83X\83\8f\81[\83h\82ª\8bó\94\92\82Å\82·\81B");
+            throw new IllegalArgumentException("メールアドレスかパスワードが空白です。");
         }
 
         String host;
@@ -43,13 +43,13 @@ public class WebFileInstanciator extends FileInstanciator {
         client = new NicoClient(li.getMail(), li.getPass(), stopFlag, host, port);
 
         if (!client.isLoggedIn()) {
-            throw new IOException("\83\8d\83O\83C\83\93\82É\8e¸\94s");
+            throw new IOException("ログインに失敗");
         }
 
         try {
             videoInfo = client.getVideoInfo(tag, time);
         } catch (IOException ex) {
-            throw new IOException(tag + "\82Ì\8fî\95ñ\82Ì\8eæ\93¾\82É\8e¸\94s", ex);
+            throw new IOException(tag + "の情報の取得に失敗", ex);
         }
 
         if (videoType.isDoanload()) {
@@ -67,8 +67,8 @@ public class WebFileInstanciator extends FileInstanciator {
     }
 
     /**
-     * \93®\89æ\82Ì\83^\83C\83g\83\8b\82ð\8eæ\93¾\82·\82é\81B
-     * \8eÀ\8dÛ\82Ì\93®\89æ\83^\83C\83g\83\8b\82Í\83t\83@\83C\83\8b\96¼\82É\97p\82¢\82é\82±\82Æ\82ª\8fo\97\88\82È\82¢\95\8e\9a\82ð\8aÜ\82ñ\82Å\82 \82é\8fê\8d\87\82ª\82 \82é\82½\82ß\81A\83t\83@\83C\83\8b\96¼\82É\93K\8d\87\82·\82é\82æ\82¤\82É\95Ò\8fW\82µ\82½\92l\82ª\95Ô\82é\81B
+     * 動画のタイトルを取得する。
+     * 実際の動画タイトルはファイル名に用いることが出来ない文字を含んである場合があるため、ファイル名に適合するように編集した値が返る。
      * @return
      */
     @Override
@@ -76,12 +76,12 @@ public class WebFileInstanciator extends FileInstanciator {
         String name = videoInfo.getVideoTitle();
         name = Normalizer.normalize(name, Normalizer.Form.NFKC);
         name = name.replaceAll("[\\\\/:*?\"<>|.]", "_");
-        name = name.replace('\u2212', '\uff0d'); // \81| U+2212(MINUS SIGN) -> U+FF0D(FULLWIDTH HYPHEN-MINUS)
-        name = name.replace('\u301c', '\uff5e'); // \81` U+301C(WAVE DASH) -> U+FF5E(FULLWIDTH TILDE)
-        name = name.replace('\u223c', '\uff5e'); // \81` U+223C(TILDE OPERATOR) -> U+FF5E(FULLWIDTH TILDE)
-        name = name.replace('\u00a2', '\uffe0'); // \81\91 U+00A2(CENT SIGN) -> U+FFE0(FULLWIDTH CENT SIGN)
-        name = name.replace('\u00a3', '\uffe1'); // \81\92 U+00A3(POUND SIGN) -> U+FFE1(FULLWIDTH POUND SIGN)
-        name = name.replace('\u00ac', '\uffe2'); // \81Ê U+00AC(NOT SIGN) -> U+FFE2(FULLWIDHT NOT SIGN)
+        name = name.replace('\u2212', '\uff0d'); //  U+2212(MINUS SIGN) -> U+FF0D(FULLWIDTH HYPHEN-MINUS)
+        name = name.replace('\u301c', '\uff5e'); //  U+301C(WAVE DASH) -> U+FF5E(FULLWIDTH TILDE)
+        name = name.replace('\u223c', '\uff5e'); //  U+223C(TILDE OPERATOR) -> U+FF5E(FULLWIDTH TILDE)
+        name = name.replace('\u00a2', '\uffe0'); //  U+00A2(CENT SIGN) -> U+FFE0(FULLWIDTH CENT SIGN)
+        name = name.replace('\u00a3', '\uffe1'); //  U+00A3(POUND SIGN) -> U+FFE1(FULLWIDTH POUND SIGN)
+        name = name.replace('\u00ac', '\uffe2'); //  U+00AC(NOT SIGN) -> U+FFE2(FULLWIDHT NOT SIGN)
         return name;
     }
 }