resources/RooUsage.txt
[app.Builder.js] / src / Builder4 / FakeServer.vala
index 5d3bfba..b788213 100644 (file)
@@ -105,32 +105,34 @@ public class FakeServerCache : Object
                
                this.fname = fname;
                
-               var  file = File.new_for_path ( BuilderApplication.configDirectory() + "/" + fname);
+               var  file = File.new_for_path ( BuilderApplication.configDirectory() + "/resources/" + fname);
                if (!file.query_exists()) {
                        this.data = "".data;
                        this.content_type = "";
                        this.size = 0;
                        return;
                }
+               try {
+                   var info = file.query_info(
+                                    "standard::*",
+                                   FileQueryInfoFlags.NONE
+                   );
                
-               var info = file.query_info(
-                                "standard::*",
-                               FileQueryInfoFlags.NONE
-               );
-               
-               this.content_type = info.get_content_type();
-               this.size = info.get_size();
-               uint8[] data;
-               size_t length;
-               try { 
-                       GLib.FileUtils.get_data(file.get_path(), out data);
+                   this.content_type = info.get_content_type();
+                   this.size = info.get_size();
+                   uint8[] data;
+                    
+                    
+                   GLib.FileUtils.get_data(file.get_path(), out data);
+                   this.data = data;
                } catch (Error e) {
                        this.data = "".data;
                        this.size = 0;
                        this.content_type = "";
                        return;
                }
-        
+               
+
          
        }
        public FakeServerCache( string fname ) {
@@ -144,16 +146,18 @@ public class FakeServerCache : Object
                        this.size = 0;
                        return;
                }
-               var info = file.query_info(
-                                "standard::*",
-                               FileQueryInfoFlags.NONE
-               );
-               this.content_type = info.get_content_type();
-               this.size = info.get_size();
-               uint8[] data;
-               size_t length;
                try { 
-                       GLib.FileUtils.get_data(file.get_path(), out data);
+                   var info = file.query_info(
+                                    "standard::*",
+                                   FileQueryInfoFlags.NONE
+                   );
+                   this.content_type = info.get_content_type();
+                   this.size = info.get_size();
+                   uint8[] data;
+       
+                   GLib.FileUtils.get_data(file.get_path(), out data);
+                   this.data = data;
                } catch (Error e) {
                        this.data = "".data;
                        this.size = 0;
@@ -161,7 +165,7 @@ public class FakeServerCache : Object
                        return;
                }
 
-               this.data = data;
+               
 
                print("FakeServerCache :%s, %s (%s/%d)\n", fname , 
                        this.content_type, this.size.to_string(), this.data.length);