OSDN Git Service

オプションファイルの必須項目は拡張子(EXT)のみとし、それ以外のデフォルト値は空文字列とする
authoryukihane <yukihane.feather@gmail.com>
Mon, 1 Aug 2011 17:14:29 +0000 (02:14 +0900)
committeryukihane <yukihane.feather@gmail.com>
Mon, 1 Aug 2011 17:14:29 +0000 (02:14 +0900)
frontend/src/saccubus/converter/profile/FfmpegOption.java

index 872296c..79dfa0e 100644 (file)
@@ -5,6 +5,7 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.util.Properties;
+import org.apache.commons.lang.StringUtils;
 
 /**
  *
@@ -22,12 +23,12 @@ public class FfmpegOption {
         Properties prop = new Properties();
         prop.loadFromXML(new FileInputStream(file));
         String ext = prop.getProperty("EXT");
-        String main = prop.getProperty("MAIN");
-        String in = prop.getProperty("IN");
-        String out = prop.getProperty("OUT");
-        String avfilter = prop.getProperty("AVFILTER");
+        String main = prop.getProperty("MAIN", "");
+        String in = prop.getProperty("IN", "");
+        String out = prop.getProperty("OUT", "");
+        String avfilter = prop.getProperty("AVFILTER", "");
 
-        if (ext == null || main == null || in == null || out == null || avfilter == null) {
+        if (StringUtils.isBlank(ext)) {
             throw new IOException("変換オプションファイル書式誤り ext: "
                     + ext + ", main: " + main + ", in: " + in + ", out: " + out + ", avfilter: " + avfilter);
         }