--- /dev/null
+package net.wpitchoune.asciidoctor;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+public final class Configuration {
+ private static final String KEY_HTML_HEADER_FILE = "html.header.file";
+ private static final String KEY_FEED_TITLE = "feed.title";
+ private static final String KEY_FEED_LINK = "feed.link";
+ private static final String KEY_FEED_DESCRIPTION = "feed.description";
+ private static final String KEY_FEED_BASEURL = "feed.baseurl";
+ private Properties properties;
+
+ private Configuration(Properties properties) {
+ this.properties = properties;
+ }
+
+ public String getFeedLink() {
+ return properties.getProperty(KEY_FEED_LINK);
+ }
+
+ public String getFeedTitle() {
+ return properties.getProperty(KEY_FEED_TITLE);
+ }
+
+ public String getFeedDescription() {
+ return properties.getProperty(KEY_FEED_DESCRIPTION);
+ }
+
+ public String getFeedBaseURL() {
+ return properties.getProperty(KEY_FEED_BASEURL);
+ }
+
+ public File getHTMLHeaderFile() {
+ String str;
+
+ str = properties.getProperty(KEY_HTML_HEADER_FILE);
+
+ if (str == null)
+ return null;
+
+ return new File(str);
+ }
+
+ public static Configuration load(File f) throws IOException {
+ Properties props;
+ InputStream in;
+
+ props = new Properties();
+ in = new FileInputStream(f);
+
+ try {
+ props.load(in);
+ } finally {
+ in.close();
+ }
+
+ return new Configuration(props);
+ }
+}