Revision d26e2ef7

b/src/gr/grnet/pithos/web/client/FilePropertiesDialog.java
39 39
import gr.grnet.pithos.web.client.rest.PostRequest;
40 40
import gr.grnet.pithos.web.client.rest.PutRequest;
41 41

  
42
import java.util.Arrays;
42 43
import java.util.HashMap;
43 44
import java.util.Map;
44 45

  
......
253 254
            PutRequest updateFile = new PutRequest(app.getApiPath(), app.getUsername(), path) {
254 255
                @Override
255 256
                public void onSuccess(Resource result) {
256
                    updateMetaData(app.getApiPath(), file.getOwner(), path + "?update=", newMeta);
257
                    updateMetaData(app.getApiPath(), file.getOwner(), path, newMeta);
257 258
                }
258 259

  
259 260
                @Override
......
302 303
            Scheduler.get().scheduleDeferred(updateFile);
303 304
        }
304 305
        else
305
            updateMetaData(app.getApiPath(), app.getUsername(), file.getUri() + "?update=", newMeta);
306
            updateMetaData(app.getApiPath(), app.getUsername(), file.getUri(), newMeta);
306 307
        return true;
307 308
	}
308 309

  
309
	protected void updateMetaData(String api, String owner, String path, Map<String, String> newMeta) {
310
	protected void updateMetaData(final String api, final String owner, final String path, Map<String, String> newMeta) {
310 311
        if (newMeta != null) {
311
            PostRequest updateFile = new PostRequest(api, owner, path) {
312
            PostRequest updateFile = new PostRequest(api, owner, path + "?update=") {
312 313
                @Override
313 314
                public void onSuccess(Resource result) {
314 315
                	if (!app.isMySharedSelected())
......
316 317
							
317 318
							@Override
318 319
							public void execute() {
320
								app.getFileList().selectByUrl(Arrays.asList(api + owner + path));
319 321
								app.updateMySharedRoot();
320 322
							}
321 323
						}, true);
322
                	else
323
                		app.updateSharedFolder(file.getParent(), true);
324
                	else {
325
                		app.updateSharedFolder(file.getParent(), true, new Command() {
326
                			
327
							@Override
328
							public void execute() {
329
								app.getFileList().selectByUrl(Arrays.asList(api + owner + path));
330
							}
331
                		});
332
                	}
324 333
                }
325 334

  
326 335
                @Override
......
351 360
				
352 361
				@Override
353 362
				public void execute() {
363
					app.getFileList().selectByUrl(Arrays.asList(api + owner + path));
354 364
					if (file.isSharedOrPublished())
355 365
						app.updateMySharedRoot();
356 366
				}
357 367
			}, true);
358
        else
368
        else {
369
			app.getFileList().selectByUrl(Arrays.asList(api + owner + path));
359 370
        	app.updateSharedFolder(file.getParent(), true);
371
        }
360 372
    }
361 373
}

Also available in: Unified diff