class DropboxLockFeature implements Lock<String> {

    @Override
    public void unlock(final Path file, final String token) throws BackgroundException {
        try {
            for(LockFileResultEntry result : new DbxUserFilesRequests(session.getClient(file)).unlockFileBatch(Collections.singletonList(
                new UnlockFileArg(containerService.getKey(file)))).getEntries()) {
                if(result.isFailure()) {
                    throw failure(result);
                }
                if(log.isDebugEnabled()) {
                    log.debug(String.format("Unlocked file %s with result %s", file, result.getSuccessValue()));
                }
            }
        }
        catch(DbxException e) {
            throw new DropboxExceptionMappingService().map("Failure to write attributes of {0}", e, file);
        }
    }

    public  DropboxLockFeature(final DropboxSession session);

}