Add configuration container.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 27 May 2013 09:40:27 +0000 (11:40 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 27 May 2013 20:54:39 +0000 (22:54 +0200)
pom.xml
src/main/java/net/pterodactylus/sonitus/config/SonitusConfiguration.java [new file with mode: 0644]

diff --git a/pom.xml b/pom.xml
index b99b01c..6a50d0a 100644 (file)
--- a/pom.xml
+++ b/pom.xml
                        <version>0.46</version>
                </dependency>
                <dependency>
+                       <groupId>com.thoughtworks.xstream</groupId>
+                       <artifactId>xstream</artifactId>
+                       <version>1.4.4</version>
+               </dependency>
+               <dependency>
                        <groupId>org.testng</groupId>
                        <artifactId>testng</artifactId>
                        <version>6.8</version>
diff --git a/src/main/java/net/pterodactylus/sonitus/config/SonitusConfiguration.java b/src/main/java/net/pterodactylus/sonitus/config/SonitusConfiguration.java
new file mode 100644 (file)
index 0000000..d40d224
--- /dev/null
@@ -0,0 +1,118 @@
+/*
+ * Sonitus - SonitusConfiguration.java - Copyright © 2013 David Roden
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.pterodactylus.sonitus.config;
+
+import com.thoughtworks.xstream.annotations.XStreamAlias;
+
+/**
+ * Sonitus instance configuration.
+ *
+ * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
+ */
+@XStreamAlias("sonitus")
+public class SonitusConfiguration {
+
+       /** The executables configuration. */
+       @XStreamAlias("executables")
+       private ExecutableConfiguration executableConfiguration;
+
+       /**
+        * Returns the executable configuration.
+        *
+        * @return The executable configuration
+        */
+       public ExecutableConfiguration getExecutableConfiguration() {
+               return executableConfiguration;
+       }
+
+       /**
+        * Configuration for the locations of the various native executables used by
+        * Sonitus.
+        *
+        * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
+        */
+       public static class ExecutableConfiguration {
+
+               /** The location of the LAME binary. */
+               @XStreamAlias("lame")
+               private String lameLocation;
+
+               /** The location of the oggdec binary. */
+               @XStreamAlias("oggdec")
+               private String oggdecLocation;
+
+               /** The location of the oggenc binary. */
+               @XStreamAlias("oggenc")
+               private String oggencLocation;
+
+               /** The location of the flac binary. */
+               @XStreamAlias("flac")
+               private String flacLocation;
+
+               /** The location of the sox binary. */
+               @XStreamAlias("sox")
+               private String soxLocation;
+
+               /**
+                * Returns the location of the LAME binary.
+                *
+                * @return The location of the LAME binary
+                */
+               public String getLameLocation() {
+                       return lameLocation;
+               }
+
+               /**
+                * Returns the location of the oggdec binary.
+                *
+                * @return The location of the oggdec binary
+                */
+               public String getOggdecLocation() {
+                       return oggdecLocation;
+               }
+
+               /**
+                * Returns the location of the oggenc binary.
+                *
+                * @return The location of the oggenc binary
+                */
+               public String getOggencLocation() {
+                       return oggencLocation;
+               }
+
+               /**
+                * Returns the location of the flac binary.
+                *
+                * @return The location of the flac binary
+                */
+               public String getFlacLocation() {
+                       return flacLocation;
+               }
+
+               /**
+                * Returns the location of the sox binary.
+                *
+                * @return The location of the sox binary
+                */
+               public String getSoxLocation() {
+                       return soxLocation;
+               }
+
+       }
+
+}