Add a convience method to create URI from path.
authorZeeshan Ali (Khattak) <zeeshanak@src.gnome.org>
Sun, 14 Dec 2008 20:21:34 +0000 (20:21 +0000)
committerZeeshan Ali (Khattak) <zeeshanak@src.gnome.org>
Sun, 14 Dec 2008 20:21:34 +0000 (20:21 +0000)
svn path=/trunk/; revision=335

src/rygel/rygel-streamer.vala

index 7ecb6b5..8b40c29 100644 (file)
@@ -49,6 +49,13 @@ public class Rygel.Streamer : GLib.Object {
         this.path_hash.set (path, mimetype);
     }
 
+    public string create_uri_for_path (string path) {
+        return "http://%s:%u%s%s".printf (this.context.host_ip,
+                                          this.context.port,
+                                          SERVER_PATH_ROOT,
+                                          path);
+    }
+
     private void server_handler (Soup.Server        server,
                                  Soup.Message       msg,
                                  string             server_path,