private OriginalFile update(Session session, final RepoFile repoFile, SqlAction sqlAction, ServiceFactory sf, OriginalFile ofile) { ExperimenterGroup group = loadUserGroup(session); ChecksumAlgorithm hasher = loadChecksum(session, repoFile.hasher().getValue()); ofile.setPath(repoFile.dirname()); ofile.setName(fileRepoSecretKey + repoFile.basename()); ofile.setRepo(uuid); ofile.setHasher(hasher); ofile.setHash(repoFile.hash()); ofile.setSize(repoFile.length()); ofile.getDetails().setGroup(group); setMimetype(ofile); ofile = sf.getUpdateService().saveAndReturnObject(ofile); final String name = ofile.getName(); if (name.startsWith(fileRepoSecretKey)) { ofile.setName(name.substring(fileRepoSecretKey.length())); } return ofile; }