Revision ff397940
b/src/gr/ebs/gss/server/ejb/ExternalAPIBean.java | ||
---|---|---|
489 | 489 |
// Do the actual work. |
490 | 490 |
final User owner = dao.getEntityById(User.class, userId); |
491 | 491 |
final Group group = dao.getEntityById(Group.class, groupId); |
492 |
final Date now = new Date(); |
|
492 | 493 |
// Only delete the group if actually owned by the user. |
493 | 494 |
if (group.getOwner().equals(owner)) { |
494 | 495 |
List<Folder> folders = dao.getFoldersPermittedForGroup(userId, groupId); |
495 | 496 |
for (Folder f : folders){ |
496 | 497 |
f.getPermissions().removeAll(group.getPermissions()); |
497 |
for(FileHeader file : f.getFiles()) |
|
498 |
touchFolder(f,owner,now); |
|
499 |
for(FileHeader file : f.getFiles()){ |
|
498 | 500 |
file.getPermissions().removeAll(group.getPermissions()); |
501 |
touchFile(file,owner,now); |
|
502 |
} |
|
499 | 503 |
} |
500 | 504 |
List<FileHeader> files = dao.getSharedFilesNotInSharedFolders(userId); |
501 | 505 |
for(FileHeader h : files) |
... | ... | |
2674 | 2678 |
return dao.findCouponUserClass(); |
2675 | 2679 |
} |
2676 | 2680 |
|
2681 |
/** |
|
2682 |
* Mark the folder as modified from the specified user and change modification date. |
|
2683 |
*/ |
|
2684 |
private void touchFolder(Folder f, User owner, Date now){ |
|
2685 |
final AuditInfo auditInfo = new AuditInfo(); |
|
2686 |
auditInfo.setCreatedBy(owner); |
|
2687 |
auditInfo.setCreationDate(now); |
|
2688 |
auditInfo.setModifiedBy(owner); |
|
2689 |
auditInfo.setModificationDate(now); |
|
2690 |
f.setAuditInfo(auditInfo); |
|
2691 |
} |
|
2692 |
|
|
2693 |
/** |
|
2694 |
* Mark the file as modified from the specified user and change modification date. |
|
2695 |
*/ |
|
2696 |
private void touchFile(FileHeader f, User owner, Date now){ |
|
2697 |
final AuditInfo auditInfo = new AuditInfo(); |
|
2698 |
auditInfo.setCreatedBy(owner); |
|
2699 |
auditInfo.setCreationDate(now); |
|
2700 |
auditInfo.setModifiedBy(owner); |
|
2701 |
auditInfo.setModificationDate(now); |
|
2702 |
f.setAuditInfo(auditInfo); |
|
2703 |
} |
|
2704 |
|
|
2677 | 2705 |
} |
Also available in: Unified diff