src/Resources.vala
authorAlan Knowles <alan@roojs.com>
Sun, 15 Mar 2015 02:55:34 +0000 (10:55 +0800)
committerAlan Knowles <alan@roojs.com>
Sun, 15 Mar 2015 02:55:34 +0000 (10:55 +0800)
src/Resources.vala

index f5d4397..972c7b6 100644 (file)
 public class Resources : Object
 {
 
-       
\ No newline at end of file
+public void fetchResourceFrom(string src, string target) 
+{
+                
+               // fetch...
+               print("downloading %s \nto : %s\n", src,res);
+               var session = new Soup.Session ();
+               session.user_agent = "App Builder ";
+               var message = new Soup.Message ("GET", 
+                       src
+                    );
+
+                   // send the HTTP request and wait for response
+                session.send_message (message);
+
+                   // output the XML result to stdout
+               FileUtils.set_contents(
+                       configDirectory() + "/resources/" + res,
+                      (string) message.response_body.data
+                    );
+
+
+       }
\ No newline at end of file