Long parentFileExplorerItemId, Long room_id, Boolean isOwner,
Long ownerId) {
log.debug(".moveFile() started");
try {
FileExplorerItem fId = this
.getFileExplorerItemsById(fileExplorerItemId);
fId.setParentFileExplorerItemId(parentFileExplorerItemId);
if (parentFileExplorerItemId == 0) {
if (isOwner) {
// move to personal Folder
fId.setOwnerId(ownerId);
} else {
// move to public room folder
fId.setOwnerId(null);
fId.setRoom_id(room_id);
}
} else {
fId.setOwnerId(null);
}
fId.setUpdated(new Date());
if (fId.getFileExplorerItemId() == 0) {
em.persist(fId);
} else {
if (!em.contains(fId)) {
em.merge(fId);
}