class EcmFileServiceImpl implements ApplicationEventPublisherAware, EcmFileService {

    @Override
    @AcmAcquireAndReleaseObjectLock(acmObjectArgIndex = 0, objectType = "FILE", lockType = "WRITE")
    public EcmFile updateFile(EcmFile ecmFile) throws AcmObjectNotFoundException
    {

        EcmFile oldFile = findById(ecmFile.getId());
        if (oldFile == null)
        {
            throw new AcmObjectNotFoundException(EcmFileConstants.OBJECT_FILE_TYPE, ecmFile.getId(), "File not found", null);
        }
        getEcmFileDao().getEm().detach(oldFile);
        Map<String, Object> eventProperties = new HashMap<>();
        eventProperties.put("oldEcmFile", oldFile);

        // Explicitly set modified to force a save to trigger transformer to reindex data when child objects are changed
        // (e.g participants)
        ecmFile.setModified(new Date());

        ecmFile = getEcmFileDao().save(ecmFile);

        publishFileUpdatedEvent(ecmFile, SecurityContextHolder.getContext().getAuthentication(), true, eventProperties);
        log.info("File update successful [{}]", ecmFile);
        return ecmFile;
    }

}