public final class Config {
- /**
- * feedurl.txtから取得した情報を格納する.
- */
- public static class NicoFeed {
-
- private final String url;
- private final int number;
-
- public NicoFeed(String url, int number) {
- this.url = url;
- this.number = number;
- }
-
- /** @return 上位いくつまでダウンロード対象とするか. */
- public int getNumber() {
- return number;
- }
-
- /** @return フィードのURL. */
- public String getUrl() {
- return url;
- }
-
- @Override
- public String toString() {
- return getUrl() + ", " + getNumber();
- }
- }
private static Log log = LogFactory.getLog(Config.class);
private static Config instance;
private final PropertiesConfiguration properties;
--- /dev/null
+package nicobrowser.config;
+
+ /**
+ * feedurl.txtから取得した情報を格納する.
+ */
+ public class NicoFeed {
+
+ private final String url;
+ private final int number;
+
+ public NicoFeed(String url, int number) {
+ this.url = url;
+ this.number = number;
+ }
+
+ /** @return 上位いくつまでダウンロード対象とするか. */
+ public int getNumber() {
+ return number;
+ }
+
+ /** @return フィードのURL. */
+ public String getUrl() {
+ return url;
+ }
+
+ @Override
+ public String toString() {
+ return getUrl() + ", " + getNumber();
+ }
+ }
import javax.swing.SwingUtilities;
import nicobrowser.config.Config;
import nicobrowser.GetFlvResult;
-import nicobrowser.config.Config.NicoFeed;
import nicobrowser.NamePattern;
import nicobrowser.NicoHttpClient;
import nicobrowser.ProgressListener;
import nicobrowser.VideoInfo;
+import nicobrowser.config.NicoFeed;
import nicobrowser.entity.NicoContent;
import nicobrowser.entity.NicoContent.Status;
import nicobrowser.gui.config.ConfigFrame;
import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.List;
-import nicobrowser.config.Config.NicoFeed;
import org.apache.commons.io.FileUtils;
import org.junit.After;
import org.junit.BeforeClass;
System.out.println("testGetFeeds");
initConfig();
- List<Config.NicoFeed> feeds = Config.getInstance().getNicoFeeds();
+ List<NicoFeed> feeds = Config.getInstance().getNicoFeeds();
assertEquals(5, feeds.size());
NicoFeed feed = feeds.get(2);
assertEquals("http://www.nicovideo.jp/tag/科学?sort=f&rss=2.0", feed.getUrl());
assertEquals(3, feed.getNumber());
- for (Config.NicoFeed nf : feeds) {
+ for (NicoFeed nf : feeds) {
System.out.println(nf);
}
}