Revision 3ca8cd89

b/web_client/src/gr/grnet/pithos/web/client/DeleteFolderDialog.java
131 131
        DeleteRequest deleteFolder = new DeleteRequest(path) {
132 132
            @Override
133 133
            public void onSuccess(Resource result) {
134

  
134
                app.updateFolder(folder.getParent());
135 135
            }
136 136

  
137 137
            @Override
138 138
            public void onError(Throwable t) {
139 139
                GWT.log("", t);
140 140
                if (t instanceof RestException) {
141
                    int statusCode = ((RestException)t).getHttpStatusCode();
142 141
                    app.displayError("Unable to delete folder: "+((RestException) t).getHttpStatusText());
143 142
                }
144 143
                else
b/web_client/src/gr/grnet/pithos/web/client/foldertree/AccountResource.java
171 171
                JSONObject o = array.get(i).isObject();
172 172
                if (o != null) {
173 173
                    Folder f = new Folder();
174
                    f.populate(o, null);
174
                    f.populate(null, o, null);
175 175
                    containers.add(f);
176 176
                }
177 177
            }
b/web_client/src/gr/grnet/pithos/web/client/foldertree/File.java
69 69

  
70 70
    private String container;
71 71

  
72
    private Folder parent;
73

  
72 74
    public String getContentType() {
73 75
        return contentType;
74 76
    }
......
137 139
        return inTrash;
138 140
    }
139 141

  
140
    public void populate(JSONObject o, String container) {
142
    public void populate(Folder parent, JSONObject o, String container) {
143
        this.parent = parent;
141 144
        path = unmarshallString(o, "name");
142 145
        if (path.contains("/"))
143 146
            name = path.substring(path.lastIndexOf("/") + 1, path.length()); //strip the prefix
b/web_client/src/gr/grnet/pithos/web/client/foldertree/Folder.java
59 59

  
60 60
    private long bytesUsed = 0;
61 61

  
62
    private Folder parent = null;
63
    
62 64
    private Set<Folder> subfolders = new LinkedHashSet<Folder>();
63 65
    /*
64 66
     * The name of the container that this folder belongs to. If this folder is container, this field equals name
......
124 126
        if (header != null)
125 127
            bytesUsed = Long.valueOf(header);
126 128

  
129
        subfolders.clear(); //This is necessary in case we update a pre-existing Folder so that stale subfolders won't show up
127 130
        JSONValue json = JSONParser.parseStrict(response.getText());
128 131
        JSONArray array = json.isArray();
129 132
        if (array != null) {
......
133 136
                    String contentType = unmarshallString(o, "content_type");
134 137
                    if (o.containsKey("subdir") || (contentType != null && (contentType.startsWith("application/directory") || contentType.startsWith("application/folder")))) {
135 138
                        Folder f = new Folder();
136
                        f.populate(o, container);
139
                        f.populate(this, o, container);
137 140
                        subfolders.add(f);
138 141
                    }
139 142
                    else {
140 143
                        File file = new File();
141
                        file.populate(o, container);
144
                        file.populate(this, o, container);
142 145
                        files.add(file);
143 146
                    }
144 147
                }
......
146 149
        }
147 150
    }
148 151

  
149
    public void populate(JSONObject o, String aContainer) {
152
    public void populate(Folder parent, JSONObject o, String aContainer) {
153
        this.parent = parent;
150 154
        String path = null;
151 155
        if (o.containsKey("subdir")) {
152 156
            path = unmarshallString(o, "subdir");
......
204 208
    public Set<File> getFiles() {
205 209
        return files;
206 210
    }
211

  
212
    public Folder getParent() {
213
        return parent;
214
    }
207 215
}

Also available in: Unified diff