--- /dev/null
+package yukihane.inqubus.config;
+
+import java.io.File;
+import saccubus.worker.profile.CommentProfile;
+
+/**
+ * コンフィグに設定された値を基にしたCommentProfile実装.
+ * @author user
+ */
+public class ConfigCommentProfile implements CommentProfile {
+
+ private final int lengthRelatedCommentSize;
+ private final int perMinCommentSize;
+ private final boolean disablePerMinComment;
+ private final long backLogPoint;
+ private final boolean download;
+ private final File dir;
+ private final String fileName;
+
+ public ConfigCommentProfile() {
+ final Config p = Config.INSTANCE;
+ this.lengthRelatedCommentSize = (p.getCommentSizeAutosize()) ? -1 : Integer.parseInt(p.getCommentSizeManual());
+ this.perMinCommentSize = (p.getCommentMinSizeAutosize()) ? -1 : Integer.parseInt(p.getCommentMinSizeManual());
+ // TODO disablePerMinComment がデフォルト設定値に無い
+ this.disablePerMinComment = false;
+ this.backLogPoint = -1L;
+ this.download = !p.getCommentUseLocal();
+ this.dir = new File(p.getCommentDir());
+ this.fileName = p.getCommentFileNamePattern();
+ }
+
+ @Override
+ public int getLengthRelatedCommentSize() {
+ return lengthRelatedCommentSize;
+ }
+
+ @Override
+ public boolean isDisablePerMinComment() {
+ return disablePerMinComment;
+ }
+
+ @Override
+ public int getPerMinCommentSize() {
+ return perMinCommentSize;
+ }
+
+ @Override
+ public long getBackLogPoint() {
+ return backLogPoint;
+ }
+
+ @Override
+ public boolean isDownload() {
+ return download;
+ }
+
+ @Override
+ public File getDir() {
+ return dir;
+ }
+
+ @Override
+ public String getFileName() {
+ return fileName;
+ }
+
+ @Override
+ public File getLocalFile() {
+ return getDir();
+ }
+}
--- /dev/null
+package yukihane.inqubus.config;
+
+import saccubus.worker.profile.CommentProfile;
+import saccubus.worker.profile.DownloadProfile;
+import saccubus.worker.profile.GeneralProfile;
+import saccubus.worker.profile.LoginProfile;
+import saccubus.worker.profile.ProxyProfile;
+import saccubus.worker.profile.VideoProfile;
+
+/**
+ * コンフィグに設定された値を基にしたDownloadProfile実装.
+ * @author user
+ */
+public class ConfigDownloadProfile implements DownloadProfile {
+
+ private final LoginProfile loginProfile;
+ private final ProxyProfile proxyProfile;
+ private final VideoProfile videoProfile;
+ private final CommentProfile commentProfile;
+ private final GeneralProfile generalProfile;
+
+ public ConfigDownloadProfile() {
+ this.loginProfile = new ConfigLoginProfile();
+ this.proxyProfile = new ConfigProxyProfile();
+ this.videoProfile = new ConfigVideoProfile();
+ this.commentProfile = new ConfigCommentProfile();
+ this.generalProfile = new ConfigGeneralProfile();
+ }
+
+ @Override
+ public LoginProfile getLoginProfile() {
+ return loginProfile;
+ }
+
+ @Override
+ public ProxyProfile getProxyProfile() {
+ return this.proxyProfile;
+ }
+
+ @Override
+ public VideoProfile getVideoProfile() {
+ return this.videoProfile;
+ }
+
+ @Override
+ public CommentProfile getCommentProfile() {
+ return this.commentProfile;
+ }
+
+ @Override
+ public GeneralProfile getGeneralProfile() {
+ return this.generalProfile;
+ }
+}
--- /dev/null
+package yukihane.inqubus.config;
+
+import saccubus.worker.profile.GeneralProfile;
+
+/**
+ * コンフィグに設定された値を基にしたGeneralProfilee実装.
+ * @author user
+ */
+public class ConfigGeneralProfile implements GeneralProfile {
+
+ private final String replaceFrom;
+ private final String replaceTo;
+
+ public ConfigGeneralProfile() {
+ final Config p = Config.INSTANCE;
+ this.replaceFrom = p.getReplaceFrom();
+ this.replaceTo = p.getReplaceTo();
+ }
+
+ @Override
+ public String getReplaceFrom() {
+ return replaceFrom;
+ }
+
+ @Override
+ public String getReplaceTo() {
+ return replaceTo;
+ }
+}
--- /dev/null
+package yukihane.inqubus.config;
+
+import saccubus.worker.profile.LoginProfile;
+
+/**
+ * コンフィグに設定された値を基にしたLoginProfile実装.
+ * @author user
+ */
+public class ConfigLoginProfile implements LoginProfile {
+
+ private final String mail;
+ private final String password;
+
+ public ConfigLoginProfile() {
+ final Config p = Config.INSTANCE;
+ this.mail = p.getPassword();
+ this.password = p.getPassword();
+ }
+
+ @Override
+ public String getMail() {
+ return mail;
+ }
+
+ @Override
+ public String getPassword() {
+ return password;
+ }
+}
--- /dev/null
+package yukihane.inqubus.config;
+
+import saccubus.worker.profile.ProxyProfile;
+
+/**
+ * コンフィグに設定された値を基にしたProxyProfile実装.
+ * @author user
+ */
+public class ConfigProxyProfile implements ProxyProfile {
+
+ private final boolean use;
+ private final String host;
+ private final int port;
+
+ public ConfigProxyProfile() {
+ final Config p = Config.INSTANCE;
+ use = p.getProxyUse();
+ host = p.getProxyHost();
+ port = Integer.parseInt(p.getProxyPort());
+ }
+
+ @Override
+ public boolean use() {
+ return use;
+ }
+
+ @Override
+ public String getHost() {
+ return host;
+ }
+
+ @Override
+ public int getPort() {
+ return port;
+ }
+}
--- /dev/null
+package yukihane.inqubus.config;
+
+import java.io.File;
+import saccubus.worker.profile.VideoProfile;
+
+/**
+ * コンフィグに設定された値を基にしたVideoProfile実装.
+ * @author user
+ */
+public class ConfigVideoProfile implements VideoProfile {
+
+ private final boolean download;
+ private final File dir;
+ private final String fileName;
+
+ public ConfigVideoProfile() {
+ final Config p = Config.INSTANCE;
+ this.download = !p.getVideoUseLocal();
+ this.dir = new File(p.getVideoDir());
+ this.fileName = p.getVideoFileNamePattern();
+ }
+
+ @Override
+ public boolean isDownload() {
+ return download;
+ }
+
+ @Override
+ public File getDir() {
+ return dir;
+ }
+
+ @Override
+ public String getFileName() {
+ return fileName;
+ }
+
+ @Override
+ public File getLocalFile() {
+ return getDir();
+ }
+}
\ No newline at end of file