updates for 0.9.4
[debian/openrocket] / src / net / sf / openrocket / communication / ConnectionSource.java
diff --git a/src/net/sf/openrocket/communication/ConnectionSource.java b/src/net/sf/openrocket/communication/ConnectionSource.java
new file mode 100644 (file)
index 0000000..b5b0fdc
--- /dev/null
@@ -0,0 +1,21 @@
+package net.sf.openrocket.communication;
+
+import java.io.IOException;
+import java.net.HttpURLConnection;
+
+/**
+ * A source for network connections.  This interface exists to enable unit testing.
+ * 
+ * @author Sampo Niskanen <sampo.niskanen@iki.fi>
+ */
+public interface ConnectionSource {
+
+       /**
+        * Return a connection to the specified url.
+        * @param url   the URL to connect to.
+        * @return              the corresponding HttpURLConnection
+        * @throws IOException  if an IOException occurs
+        */
+       public HttpURLConnection getConnection(String url) throws IOException;
+       
+}