Revision d114cfe2 src/gr/ebs/gss/server/rest/FilesHandler.java
b/src/gr/ebs/gss/server/rest/FilesHandler.java | ||
---|---|---|
1383 | 1383 |
String name = null; |
1384 | 1384 |
if (json.opt("name") != null) |
1385 | 1385 |
name = json.optString("name"); |
1386 |
Long modificationDate = null; |
|
1387 |
if (json.optLong("modificationDate") != 0) |
|
1388 |
modificationDate = json.optLong("modificationDate"); |
|
1386 | 1389 |
JSONArray tagset = json.optJSONArray("tags"); |
1387 | 1390 |
String tags = null; |
1388 | 1391 |
StringBuffer t = new StringBuffer(); |
... | ... | |
1391 | 1394 |
t.append(tagset.getString(i) + ','); |
1392 | 1395 |
tags = t.toString(); |
1393 | 1396 |
} |
1394 |
if (name != null || tags != null) { |
|
1397 |
if (name != null || tags != null || modificationDate != null) {
|
|
1395 | 1398 |
final String fName = name; |
1396 | 1399 |
final String fTags = tags; |
1400 |
final Date mDate = modificationDate != null? new Date(modificationDate): null; |
|
1397 | 1401 |
new TransactionHelper<Object>().tryExecute(new Callable<Object>() { |
1398 | 1402 |
@Override |
1399 | 1403 |
public Object call() throws Exception { |
1400 |
getService().updateFile(user.getId(), file.getId(), fName, fTags); |
|
1404 |
getService().updateFile(user.getId(), file.getId(), fName, fTags, mDate);
|
|
1401 | 1405 |
return null; |
1402 | 1406 |
} |
1403 | 1407 |
|
Also available in: Unified diff