Fixed folder deletion with all subfolders and files
[pithos] / web_client / src / gr / grnet / pithos / web / client / foldertree / File.java
index d69e881..9a17ba8 100644 (file)
@@ -69,6 +69,8 @@ public class File extends Resource {
 
     private String container;
 
+    private Folder parent;
+
     public String getContentType() {
         return contentType;
     }
@@ -97,13 +99,8 @@ public class File extends Resource {
         return versionTimestamp;
     }
 
-    @Override
-    public String getLastModifiedSince() {
-        return null;  //To change body of implemented methods use File | Settings | File Templates.
-    }
-
     public String getUri() {
-        return path + "/" + name;
+        return "/" + container + "/" + path;
     }
 
     public String getOwner() {
@@ -137,7 +134,8 @@ public class File extends Resource {
         return inTrash;
     }
 
-    public void populate(JSONObject o, String container) {
+    public void populate(Folder parent, JSONObject o, String container) {
+        this.parent = parent;
         path = unmarshallString(o, "name");
         if (path.contains("/"))
             name = path.substring(path.lastIndexOf("/") + 1, path.length()); //strip the prefix
@@ -184,4 +182,8 @@ public class File extends Resource {
         JSONValue json = JSONParser.parseStrict(response.getText());
         JSONObject o = json.isObject();
     }
+
+    public Folder getParent() {
+        return parent;
+    }
 }