3 import java.util.Properties;
4 import java.io.IOException;
5 import java.io.FileOutputStream;
6 import java.io.FileInputStream;
8 import org.apache.commons.io.FilenameUtils;
12 *
\83^
\83C
\83g
\83\8b:
\82³
\82«
\82ã
\82Î
\82·
16 *
\90à
\96¾:
\83j
\83R
\83j
\83R
\93®
\89æ
\82Ì
\93®
\89æ
\82ð
\83R
\83\81\83\93\83g
\82Â
\82«
\82Å
\95Û
\91¶
20 *
\92\98\8dì
\8c : Copyright (c) 2007 PSI
27 * @author
\96¢
\93ü
\97Í
30 public class ConvertingSetting {
32 public static final String[] ShadowKindArray = {
34 "01:
\83j
\83R
\83j
\83R
\93®
\89æ
\95\97",
36 "03:
\88Í
\82¢
\8d\9e\82Ý"
38 private final String MailAddress;
39 private final String Password;
40 private final VideoSaveKind saveVideo;
41 private final File VideoFile;
42 private final boolean SaveComment;
43 private final File CommentFile;
44 private final boolean SaveConverted;
45 private final boolean addComment;
46 private final boolean addTcomment;
47 private final File ConvertedVideoFile;
48 private final String FFmpegPath;
49 private final String VhookPath;
50 private final String CmdLineOptionExt;
51 private final String CmdLineOptionIn;
52 private final String CmdLineOptionOut;
53 private final String CmdLineOptionMain;
54 private final String FontPath;
55 private final int FontIndex;
56 private final String BackComment;
57 private final boolean Vhook_ShowConvertingVideo;
58 private final int VideoShowNum;
59 private final boolean DeleteVideoAfterConverting;
60 private final boolean VideoFixFileName;
61 private final File VideoFixFileNameFolder;
62 private final boolean DeleteCommentAfterConverting;
63 private final boolean CommentFixFileName;
64 private final File CommentFixFileNameFolder;
65 private final TcommentSetting tcommentSetting;
66 private final boolean ConvFixFileName;
67 private final File ConvFixFileNameFolder;
68 private final String NG_Word;
69 private final String NG_ID;
70 private final boolean UseProxy;
71 private final String Proxy;
72 private final int ProxyPort;
73 private final boolean FixFontSize;
74 private final boolean FixCommentNum;
75 private final boolean OpaqueComment;
76 private final boolean NotAddVideoID_Conv;
77 private final File OptionFile;
78 private final boolean DisableVhook;
79 private final int ShadowIndex;
81 public ConvertingSetting(
84 VideoSaveKind savevideo,
88 boolean saveconverted,
95 String cmdlineoption_ext,
96 String cmdlineoption_main,
97 String cmdlineoption_in,
98 String cmdlineoption_out,
102 boolean showconvvideo,
103 boolean delete_video_after_conv,
104 boolean video_fix_file_name,
105 String video_fix_file_name_folder,
106 boolean delete_comment_after_conv,
107 boolean comment_fix_file_name,
108 String comment_fix_file_name_folder,
109 TcommentSetting tcommentSetting,
110 boolean not_add_videoid_conv,
111 boolean conv_fix_file_name,
112 String conv_fix_file_name_folder,
118 boolean fix_font_size,
119 boolean fix_comment_num,
120 boolean opaque_comment,
121 File option_file, boolean disable_vhook,
123 MailAddress = mailaddress;
125 this.saveVideo = savevideo;
126 if (videofile.lastIndexOf(".") < videofile.lastIndexOf("\\")) {
129 VideoFile = new File(videofile);
130 SaveComment = savecomment;
131 if (commentfile.lastIndexOf(".") < commentfile.lastIndexOf("\\")) {
132 commentfile += ".xml";
134 CommentFile = new File(commentfile);
135 SaveConverted = saveconverted;
136 this.addComment = addComment;
137 this.addTcomment = addTcomment;
138 if (convvideofile.lastIndexOf(".") < convvideofile.lastIndexOf("\\")) {
139 convvideofile += ".avi";
141 ConvertedVideoFile = new File(convvideofile);
144 num = Integer.parseInt(videoshownum);
145 } catch (NumberFormatException ex) {
148 FFmpegPath = ffmpegpath;
149 VhookPath = vhookpath;
150 CmdLineOptionExt = cmdlineoption_ext;
151 CmdLineOptionMain = cmdlineoption_main;
152 CmdLineOptionIn = cmdlineoption_in;
153 CmdLineOptionOut = cmdlineoption_out;
154 BackComment = backcomment;
156 FontIndex = font_index;
157 Vhook_ShowConvertingVideo = showconvvideo;
158 DeleteVideoAfterConverting = delete_video_after_conv;
159 VideoFixFileName = video_fix_file_name;
160 VideoFixFileNameFolder = new File(video_fix_file_name_folder, "");
161 DeleteCommentAfterConverting = delete_comment_after_conv;
162 CommentFixFileName = comment_fix_file_name;
163 CommentFixFileNameFolder = new File(comment_fix_file_name_folder, "");
164 this.tcommentSetting = tcommentSetting;
165 NotAddVideoID_Conv = not_add_videoid_conv;
166 ConvFixFileName = conv_fix_file_name;
167 ConvFixFileNameFolder = new File(conv_fix_file_name_folder, "");
170 UseProxy = use_proxy;
172 ProxyPort = proxy_port;
173 FixFontSize = fix_font_size;
174 FixCommentNum = fix_comment_num;
175 OpaqueComment = opaque_comment;
176 OptionFile = option_file;
177 DisableVhook = disable_vhook;
178 ShadowIndex = shadow_index;
181 public File getVideoFile() {
185 public File getCommentFile() {
189 public File getConvertedVideoFile() {
190 return ConvertedVideoFile;
193 public String getFFmpegPath() {
197 public String getVhookPath() {
201 public String getCmdLineOptionIn() {
202 return CmdLineOptionIn;
205 public String getFontPath() {
209 public String getFontIndex() {
210 return Integer.toString(FontIndex);
213 public boolean isVhook_ShowConvertingVideo() {
214 return Vhook_ShowConvertingVideo;
217 public String getMailAddress() {
221 public String getPassword() {
225 public VideoSaveKind getVideoSaveKind() {
229 public boolean isSaveComment() {
233 /** @return
\81u
\83R
\83\81\83\93\83g
\95t
\82«
\93®
\89æ
\82É
\95Ï
\8a·
\82·
\82é
\81v
\82È
\82çtrue. */
234 public boolean isSaveConverted() {
235 return SaveConverted;
237 /** @return
\95Ï
\8a·
\93®
\89æ
\82É
\83R
\83\81\83\93\83g
\82ð
\82Â
\82¯
\82é
\82È
\82çtrue. */
238 public boolean getAddComment() {
242 /** @return
\95Ï
\8a·
\93®
\89æ
\82É
\93\8a\8de
\8eÒ
\83R
\83\81\83\93\83g
\82ð
\82Â
\82¯
\82é
\82È
\82çtrue. */
243 public boolean getAddTcomment() {
248 public String getCmdLineOptionOut() {
249 return CmdLineOptionOut;
252 public String getBackComment() {
256 public String getVideoShowNum() {
257 return Integer.toString(VideoShowNum);
260 public String getCmdLineOptionExt() {
261 return CmdLineOptionExt;
264 public String getCmdLineOptionMain() {
265 return CmdLineOptionMain;
269 * @return
\93®
\89æ
\95Û
\91¶
\90Ý
\92è
\82Å
\81u
\95Û
\91¶
\82·
\82é
\83t
\83H
\83\8b\83_
\82ð
\8ew
\92è
\82µ
\81A
\83t
\83@
\83C
\83\8b\96¼
\82Í
\8e©
\93®
\82Å
\8c\88\92è
\82·
\82é
\81v
\82Ì
\82Å
\82 \82ê
\82Îtrue.
270 *
\81u
\95Û
\91¶
\82·
\82é
\83t
\83@
\83C
\83\8b\96¼
\82ð
\8ew
\92è
\82·
\82é
\81v
\82Ì
\82Å
\82 \82ê
\82Îfalse.
272 public boolean isVideoFixFileName() {
273 return VideoFixFileName;
276 public boolean isDeleteVideoAfterConverting() {
277 return DeleteVideoAfterConverting;
280 public File getVideoFixFileNameFolder() {
281 return VideoFixFileNameFolder;
284 public boolean isCommentFixFileName() {
285 return CommentFixFileName;
288 public boolean isDeleteCommentAfterConverting() {
289 return DeleteCommentAfterConverting;
292 public File getCommentFixFileNameFolder() {
293 return CommentFixFileNameFolder;
296 public boolean isNotAddVideoID_Conv() {
297 return NotAddVideoID_Conv;
300 public boolean isConvFixFileName() {
301 return ConvFixFileName;
304 public File getConvFixFileNameFolder() {
305 return ConvFixFileNameFolder;
308 public String getNG_Word() {
312 public String getNG_ID() {
316 public boolean useProxy() {
320 public String getProxy() {
324 public int getProxyPort() {
328 public boolean isFixFontSize() {
332 public boolean isFixCommentNum() {
333 return FixCommentNum;
336 public boolean isOpaqueComment() {
337 return OpaqueComment;
340 public File getOptionFile() {
344 public boolean isVhookDisabled() {
348 public int getShadowIndex() {
351 private static final String PROP_FILE = "./saccubus.xml";
352 private static final String PROP_MAILADDR = "MailAddress";
353 private static final String PROP_PASSWORD = "Password";
354 private static final String PROP_SAVE_VIDEO = "SaveVideoFile";
355 private static final String PROP_VIDEO_FILE = "VideoFile";
356 private static final String PROP_SAVE_COMMENT = "SaveCommentFile";
357 private static final String PROP_COMMENT_FILE = "CommentFile";
358 private static final String PROP_SAVE_CONVERTED = "SaveConvertedFile";
359 private static final String PROP_ADD_COMMENT = "AddComment";
360 private static final String PROP_ADD_TCOMMENT = "AddTcomment";
361 private static final String PROP_CONVERTED_FILE = "ConvertedFile";
362 private static final String PROP_FFMPEG_PATH = "FFnpegPath";
363 private static final String PROP_VHOOK_PATH = "VhookPath";
364 private static final String PROP_FONT_PATH = "FontPath";
365 private static final String PROP_FONT_INDEX = "FontIndex";
366 private static final String PROP_CMDLINE_EXT = "CMD_EXT";
367 private static final String PROP_CMDLINE_MAIN = "CMD_MAIN";
368 private static final String PROP_CMDLINE_IN = "CMD_IN";
369 private static final String PROP_CMDLINE_OUT = "CMD_OUT";
370 private static final String PROP_BACK_COMMENT = "BackComment";
371 private static final String PROP_SHOW_VIDEO = "ShowVideo";
372 private static final String PROP_SHOW_COMMENT = "ShowCommentNum";
373 private static final String PROP_VIDEO_FIX_FILE_NAME = "VideoFixFileName";
374 private static final String PROP_DEL_VIDEO_AFTER_CONV = "DeleteVideoAfterConv";
375 private static final String PROP_VIDEO_FIX_FILE_NAME_FOLDER = "VideoFixFileNameFolder";
376 private static final String PROP_DEL_COMMENT_AFTER_CONV = "DeleteCommentAfterConv";
377 private static final String PROP_COMMENT_FIX_FILE_NAME = "CommentFixFileName";
378 private static final String PROP_COMMENT_FIX_FILE_NAME_FOLDER = "CommentFixFileNameFolder";
379 private static final String PROP_NOT_ADD_VIDEOID_CONV = "NotAddVideoIDtoConverted";
380 private static final String PROP_CONV_FIX_FILE_NAME = "ConvFixFileName";
381 private static final String PROP_CONV_FIX_FILE_NAME_FOLDER = "ConvFixFileNameFolder";
382 private static final String PROP_NG_WORD = "NG_Word";
383 private static final String PROP_NG_ID = "NG_ID";
384 private static final String PROP_USE_PROXY = "UseProxy";
385 private static final String PROP_PROXY = "Proxy";
386 private static final String PROP_PROXY_PORT = "ProxyPort";
387 private static final String PROP_FIX_FONT_SIZE = "FixFontSize";
388 private static final String PROP_FIX_COMMENT_NUM = "FixCommentSize";
389 private static final String PROP_OPAQUE_COMMENT = "OpaqueComment";
390 private static final String PROP_OPTION_FILE = "OptionFile";
391 private static final String PROP_DISABLE_VHOOK = "VhookDisabled";
392 private static final String PROP_SHADOW_INDEX = "ShadowIndex";
394 public static void saveSetting(ConvertingSetting setting) {
395 Properties prop = new Properties();
396 prop.setProperty(PROP_MAILADDR, setting.getMailAddress());
397 prop.setProperty(PROP_PASSWORD, setting.getPassword());
398 prop.setProperty(PROP_SAVE_VIDEO, setting.getVideoSaveKind().toString());
399 prop.setProperty(PROP_VIDEO_FILE, setting.getVideoFile().getPath());
400 prop.setProperty(PROP_SAVE_COMMENT, Boolean.toString(setting.isSaveComment()));
401 prop.setProperty(PROP_COMMENT_FILE, setting.getCommentFile().getPath());
402 prop.setProperty(PROP_SAVE_CONVERTED, Boolean.toString(setting.isSaveConverted()));
403 prop.setProperty(PROP_ADD_COMMENT, Boolean.toString(setting.getAddComment()));
404 prop.setProperty(PROP_ADD_TCOMMENT, Boolean.toString(setting.getAddTcomment()));
405 prop.setProperty(PROP_SHOW_COMMENT, setting.getVideoShowNum());
406 prop.setProperty(PROP_CONVERTED_FILE, setting.getConvertedVideoFile().getPath());
407 prop.setProperty(PROP_FFMPEG_PATH, setting.getFFmpegPath());
408 prop.setProperty(PROP_VHOOK_PATH, setting.getVhookPath());
409 prop.setProperty(PROP_FONT_PATH, setting.getFontPath());
410 prop.setProperty(PROP_FONT_INDEX, setting.getFontIndex());
411 prop.setProperty(PROP_CMDLINE_EXT, setting.getCmdLineOptionExt());
412 prop.setProperty(PROP_CMDLINE_MAIN, setting.getCmdLineOptionMain());
413 prop.setProperty(PROP_CMDLINE_IN, setting.getCmdLineOptionIn());
414 prop.setProperty(PROP_CMDLINE_OUT, setting.getCmdLineOptionOut());
415 prop.setProperty(PROP_BACK_COMMENT, setting.getBackComment());
416 prop.setProperty(PROP_SHOW_VIDEO, Boolean.toString((setting.isVhook_ShowConvertingVideo())));
417 prop.setProperty(PROP_DEL_VIDEO_AFTER_CONV, Boolean.toString(setting.isDeleteVideoAfterConverting()));
418 prop.setProperty(PROP_VIDEO_FIX_FILE_NAME, Boolean.toString(setting.isVideoFixFileName()));
419 prop.setProperty(PROP_VIDEO_FIX_FILE_NAME_FOLDER, setting.getVideoFixFileNameFolder().getPath());
420 prop.setProperty(PROP_DEL_COMMENT_AFTER_CONV, Boolean.toString(setting.isDeleteCommentAfterConverting()));
421 prop.setProperty(PROP_COMMENT_FIX_FILE_NAME, Boolean.toString(setting.isCommentFixFileName()));
422 prop.setProperty(PROP_COMMENT_FIX_FILE_NAME_FOLDER, setting.getCommentFixFileNameFolder().getPath());
424 setting.getTcommentSetting().save(prop);
426 prop.setProperty(PROP_NOT_ADD_VIDEOID_CONV, Boolean.toString(setting.isNotAddVideoID_Conv()));
428 prop.setProperty(PROP_CONV_FIX_FILE_NAME, (new Boolean(setting.isConvFixFileName())).toString());
429 prop.setProperty(PROP_CONV_FIX_FILE_NAME_FOLDER, setting.getConvFixFileNameFolder().getPath());
431 prop.setProperty(PROP_NG_WORD, setting.getNG_Word());
432 prop.setProperty(PROP_NG_ID, setting.getNG_ID());
433 prop.setProperty(PROP_USE_PROXY, Boolean.toString(setting.useProxy()));
434 prop.setProperty(PROP_PROXY, setting.getProxy());
435 prop.setProperty(PROP_PROXY_PORT, Integer.toString(setting.getProxyPort()));
436 prop.setProperty(PROP_FIX_FONT_SIZE, Boolean.toString(setting.isFixFontSize()));
437 prop.setProperty(PROP_FIX_COMMENT_NUM, Boolean.toString(setting.isFixCommentNum()));
438 prop.setProperty(PROP_OPAQUE_COMMENT, Boolean.toString(setting.isOpaqueComment()));
439 if (setting.getOptionFile() != null) {
440 prop.setProperty(PROP_OPTION_FILE, setting.getOptionFile().getPath());
442 prop.setProperty(PROP_DISABLE_VHOOK, Boolean.toString(setting.isVhookDisabled()));
443 prop.setProperty(PROP_SHADOW_INDEX, Integer.toString(setting.getShadowIndex()));
445 prop.storeToXML(new FileOutputStream(PROP_FILE), "settings");
446 } catch (IOException ex) {
447 ex.printStackTrace();
451 /**
\96{
\89Æ
\82³
\82«
\82ã
\82Î
\82·
\82Å
\95Û
\91¶
\82µ
\82Ä
\82¢
\82½
\8fê
\8d\87\81APROP_SAVE_VIDEO
\82Ítrue/false
\82È
\82Ì
\82Å
\95Ï
\8a·
\82·
\82é. */
452 private static VideoSaveKind convertVideoSaveKind(Properties prop) {
454 String saveVideo = prop.getProperty(PROP_SAVE_VIDEO);
455 if (Boolean.toString(true).equals(saveVideo) || saveVideo == null) {
456 kind = VideoSaveKind.SAVE;
457 } else if (Boolean.toString(false).equals(saveVideo)) {
458 kind = VideoSaveKind.NO_SAVE;
460 kind = VideoSaveKind.valueOf(saveVideo);
465 public static ConvertingSetting loadSetting(String user, String password) {
466 Properties prop = new Properties();
468 prop.loadFromXML(new FileInputStream(PROP_FILE));
469 } catch (IOException ex) {
470 ex.printStackTrace();
473 user = prop.getProperty(PROP_MAILADDR, "");
475 if (password == null) {
476 password = prop.getProperty(PROP_PASSWORD, "");
478 String option_file_name = prop.getProperty(PROP_OPTION_FILE, null);
479 File option_file = null;
480 if (option_file_name != null) {
481 option_file = new File(option_file_name);
483 String win_dir = System.getenv("windir");
484 if (!win_dir.endsWith("\\")) {
485 win_dir = win_dir + "\\";
488 final VideoSaveKind kind = convertVideoSaveKind(prop);
489 return new ConvertingSetting(
493 prop.getProperty(PROP_VIDEO_FILE, ".\\video.flv"),
494 Boolean.parseBoolean(prop.getProperty(PROP_SAVE_COMMENT, "true")),
495 prop.getProperty(PROP_COMMENT_FILE, ".\\comment.xml"),
496 Boolean.parseBoolean(prop.getProperty(PROP_SAVE_CONVERTED, "true")),
497 Boolean.valueOf(prop.getProperty(PROP_ADD_COMMENT, "true")),
498 Boolean.valueOf(prop.getProperty(PROP_ADD_TCOMMENT, "false")),
499 prop.getProperty(PROP_CONVERTED_FILE, ".\\video.avi"),
500 prop.getProperty(PROP_SHOW_COMMENT, "30"),
501 prop.getProperty(PROP_FFMPEG_PATH, ".\\bin\\ffmpeg.exe"),
502 prop.getProperty(PROP_VHOOK_PATH, ".\\bin\\nicovideo.dll"),
503 prop.getProperty(PROP_CMDLINE_EXT, "avi"),
504 prop.getProperty(PROP_CMDLINE_MAIN, ""),
505 prop.getProperty(PROP_CMDLINE_IN, ""),
506 prop.getProperty(PROP_CMDLINE_OUT, "-f ipod"),
507 prop.getProperty(PROP_BACK_COMMENT, "500"),
508 prop.getProperty(PROP_FONT_PATH, win_dir + "Fonts\\msgothic.ttc"),
509 Integer.parseInt(prop.getProperty(PROP_FONT_INDEX, "1")),
510 Boolean.parseBoolean(prop.getProperty(PROP_SHOW_VIDEO, "true")),
511 Boolean.parseBoolean(prop.getProperty(PROP_DEL_VIDEO_AFTER_CONV, "false")),
512 Boolean.parseBoolean(prop.getProperty(PROP_VIDEO_FIX_FILE_NAME, "true")),
513 prop.getProperty(PROP_VIDEO_FIX_FILE_NAME_FOLDER, ".\\[in]video\\"),
514 Boolean.parseBoolean(prop.getProperty(PROP_DEL_COMMENT_AFTER_CONV, "false")),
515 Boolean.parseBoolean(prop.getProperty(PROP_COMMENT_FIX_FILE_NAME, "true")),
516 prop.getProperty(PROP_COMMENT_FIX_FILE_NAME_FOLDER, ".\\[in]comment\\"),
517 TcommentSetting.load(prop),
518 Boolean.parseBoolean(prop.getProperty(PROP_NOT_ADD_VIDEOID_CONV, "false")),
519 Boolean.parseBoolean(prop.getProperty(PROP_CONV_FIX_FILE_NAME, "true")),
520 prop.getProperty(PROP_CONV_FIX_FILE_NAME_FOLDER, ".\\[out]converted\\"),
521 prop.getProperty(PROP_NG_WORD, ""),
522 prop.getProperty(PROP_NG_ID, ""),
523 Boolean.parseBoolean(prop.getProperty(PROP_USE_PROXY, "false")),
524 prop.getProperty(PROP_PROXY, ""),
525 Integer.parseInt(prop.getProperty(PROP_PROXY_PORT, "-1")),
526 Boolean.parseBoolean(prop.getProperty(PROP_FIX_FONT_SIZE, "true")),
527 Boolean.parseBoolean(prop.getProperty(PROP_FIX_COMMENT_NUM, "true")),
528 Boolean.parseBoolean(prop.getProperty(PROP_OPAQUE_COMMENT, "false")),
529 option_file, Boolean.parseBoolean(prop.getProperty(PROP_DISABLE_VHOOK, "false")),
530 Integer.parseInt(prop.getProperty(PROP_SHADOW_INDEX, "1"),
534 public TcommentSetting getTcommentSetting() {
535 return tcommentSetting;
538 public static class TcommentSetting {
540 private final boolean download;
541 private final boolean delete;
542 private final boolean autoFileName;
543 private final String inputDirectory;
544 private final String inputFile;
546 public boolean isAutoFileName() {
550 public boolean isDelete() {
554 public boolean isDownload() {
558 /** @return
\83\86\81[
\83U
\82ª
\81u
\95Û
\91¶
\82·
\82é
\83t
\83H
\83\8b\83_
\82ð
\8ew
\92è
\82µ
\81A
\83t
\83@
\83C
\83\8b\96¼
\82Í
\8e©
\93®
\82Å
\8c\88\92è
\82·
\82é
\81v
\83e
\83L
\83X
\83g
\83t
\83B
\81[
\83\8b\83h
\82É
\93ü
\97Í
\82µ
\82½
\92l. */
559 public String getInputDirectory() {
560 return inputDirectory;
563 /** @return
\83\86\81[
\83U
\82ª
\81u
\95Û
\91¶
\82·
\82é
\83t
\83@
\83C
\83\8b\96¼
\82ð
\8ew
\92è
\82·
\82é
\81v
\83e
\83L
\83X
\83g
\83t
\83B
\81[
\83\8b\83h
\82É
\93ü
\97Í
\82µ
\82½
\92l. */
564 public String getInputFile() {
568 /** @return
\95Û
\91¶
\90æ
\83f
\83B
\83\8c\83N
\83g
\83\8a. autoFileName
\82ªfalse
\82Ì
\8fê
\8d\87\82à,
\83t
\83@
\83C
\83\8b\96¼
\82Í
\93ü
\82ç
\82È
\82¢
\82±
\82Æ
\82É
\92\8d\88Ó. */
569 public File getDirectory() {
571 return new File(inputDirectory);
573 File parent = new File(inputFile).getParentFile();
574 if (parent == null) {
575 parent = new File("");
581 /** @return
\95Û
\91¶
\83t
\83@
\83C
\83\8b\96¼. autoFileName
\82ªtrue
\82È
\82ç
\8fí
\82Énull. */
582 public String getFileName() {
583 return FilenameUtils.getName(inputFile.toString());
587 *
\81u
\93ü
\97Í
\93\8a\8de
\8eÒ
\83R
\83\81\83\93\83g
\81v
\83p
\83l
\83\8b\82Ì
\90Ý
\92è.
588 * @param download
\83_
\83E
\83\93\83\8d\81[
\83h
\82·
\82é
\95K
\97v
\82ª
\82 \82ê
\82Îtrue.
\83\8d\81[
\83J
\83\8b\82É
\82 \82é
\83t
\83@
\83C
\83\8b\82ð
\97p
\82¢
\82é
\82Ì
\82Å
\82 \82ê
\82Îfalse.
589 * @param delete
\8f\88\97\9d\8fI
\97¹
\8cã
\83t
\83@
\83C
\83\8b\82ð
\8dí
\8f\9c\82·
\82é
\82Ì
\82Å
\82 \82ê
\82Îtrue.
\8ec
\82µ
\82½
\82Ü
\82Ü
\82Å
\82 \82ê
\82Îfalse.
590 * @param inputDirectory
\83\86\81[
\83U
\82ª
\81u
\95Û
\91¶
\82·
\82é
\83t
\83H
\83\8b\83_
\82ð
\8ew
\92è
\82µ
\81A
\83t
\83@
\83C
\83\8b\96¼
\82Í
\8e©
\93®
\82Å
\8c\88\92è
\82·
\82é
\81v
\83e
\83L
\83X
\83g
\83t
\83B
\81[
\83\8b\83h
\82É
\93ü
\97Í
\82µ
\82½
\92l.
591 * @param inputFile
\83\86\81[
\83U
\82ª
\81u
\95Û
\91¶
\82·
\82é
\83t
\83@
\83C
\83\8b\96¼
\82ð
\8ew
\92è
\82·
\82é
\81v
\83e
\83L
\83X
\83g
\83t
\83B
\81[
\83\8b\83h
\82É
\93ü
\97Í
\82µ
\82½
\92l.
593 public TcommentSetting(boolean download, boolean delete, boolean autoFileName, String inputDirectory,
595 this.download = download;
596 this.delete = delete;
597 this.autoFileName = autoFileName;
598 this.inputDirectory = inputDirectory;
599 this.inputFile = inputFile;
602 public static TcommentSetting load(Properties prop) {
604 str = prop.getProperty(PROP_DOWNLOAD, Boolean.toString(true));
605 boolean down = Boolean.valueOf(str);
606 str = prop.getProperty(PROP_DELETE, Boolean.toString(false));
607 boolean del = Boolean.valueOf(str);
608 str = prop.getProperty(PROP_AUTOFILENAME, Boolean.toString(true));
609 boolean naming = Boolean.valueOf(str);
610 String dir = prop.getProperty(PROP_DIRECTORYNAME, ".\\[in]tcomment");
611 String f = prop.getProperty(PROP_FILENAME, ".\\tcomment.xml");
612 return new TcommentSetting(down, del, naming, dir, f);
615 public void save(Properties prop) {
616 prop.setProperty(PROP_DOWNLOAD, Boolean.toString(download));
617 prop.setProperty(PROP_DELETE, Boolean.toString(delete));
618 prop.setProperty(PROP_AUTOFILENAME, Boolean.toString(autoFileName));
619 prop.setProperty(PROP_DIRECTORYNAME, inputDirectory.toString());
620 prop.setProperty(PROP_FILENAME, inputFile.toString());
622 private static final String PROP_DOWNLOAD = "TCDownload";
623 private static final String PROP_DELETE = "TCDelete";
624 private static final String PROP_AUTOFILENAME = "TCAutoNaming";
625 private static final String PROP_DIRECTORYNAME = "TCDirectory";
626 private static final String PROP_FILENAME = "TCFileName";