From: Jan-Pascal van Best Date: Sat, 10 Mar 2012 21:39:19 +0000 (+0100) Subject: First start implementing --configure X-Git-Tag: 0.2~14 X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=57879f11a3389176ef7dcb5bdc0cb80ec6d81c71;p=tv_grab_nl_java First start implementing --configure --- diff --git a/tv_grab_nl_java/pom.xml b/tv_grab_nl_java/pom.xml index 59dfdab..ff9e221 100644 --- a/tv_grab_nl_java/pom.xml +++ b/tv_grab_nl_java/pom.xml @@ -10,15 +10,15 @@ 2.4 jdk15 - - org.apache.commons - commons-io - 1.3.2 - commons-cli commons-cli 1.2 + + commons-io + commons-io + 2.1 + \ No newline at end of file diff --git a/tv_grab_nl_java/src/org/vanbest/xmltv/Config.java b/tv_grab_nl_java/src/org/vanbest/xmltv/Config.java new file mode 100644 index 0000000..b4c124d --- /dev/null +++ b/tv_grab_nl_java/src/org/vanbest/xmltv/Config.java @@ -0,0 +1,32 @@ +package org.vanbest.xmltv; + +import java.io.File; +import java.io.IOException; +import java.util.List; + +import org.apache.commons.io.FileUtils; + +public class Config { + public String configFile; + public List channels; + + public Config() { + } + + public void writeConfig() { + + } + + public static File defaultConfigFile() { + return FileUtils.getFile(FileUtils.getUserDirectory(), ".xmltv", "tv_grab_nl_java.conf"); + } + + public static Config readConfig() throws IOException { + return readConfig(defaultConfigFile().getCanonicalPath()); + } + + public static Config readConfig(String filename) { + Config result = new Config(); + return result; + } +} diff --git a/tv_grab_nl_java/src/org/vanbest/xmltv/Main.java b/tv_grab_nl_java/src/org/vanbest/xmltv/Main.java index 6c85c0f..6b7262f 100644 --- a/tv_grab_nl_java/src/org/vanbest/xmltv/Main.java +++ b/tv_grab_nl_java/src/org/vanbest/xmltv/Main.java @@ -56,7 +56,15 @@ public class Main { } } - public static void main(String[] args) { + public void configure() { + TvGids gids = new TvGids(); + + List channels = gids.getChannels(); + + + } + + public void processOptions(String[] args) { Options options = new Options(); options.addOption("d", "description", false, "Display a description to identify this grabber"); options.addOption("c", "capablities", false, "Show grabber capabilities"); @@ -88,7 +96,16 @@ public class Main { // System.out.println("preferredmethod"); System.exit(0); } - + if (line.hasOption("n")) { + configure(); + System.exit(0); + } + + } + + public static void main(String[] args) { + Main main = new Main(); + main.processOptions(args); } }