class FileConnection implements ObjectStoreConnection {

    @Override
    public boolean updatePolicy(String domainName, Policy policy) {
        DomainStruct domainStruct = getDomainStruct(domainName);
        if (domainStruct == null) {
            throw ZMSUtils.error(ResourceException.NOT_FOUND, "domain not found", "updatePolicy");
        }

        if (domainStruct.getPolicies() == null) {
            domainStruct.setPolicies(new HashMap<>());
        }
        HashMap<String, Policy> policies = domainStruct.getPolicies();
        
        String policyName = ZMSUtils.extractPolicyName(domainName, policy.getName());

        // here we only need to update the main attrs and not
        // the assertions

        List<Assertion> assertions = policy.getAssertions();
        Policy originalPolicy = getPolicyObject(domainStruct, policyName);
        if (originalPolicy != null) {
            policy.setAssertions(originalPolicy.getAssertions());
        } else {
            policy.setAssertions(null);
        }
        policy.setModified(Timestamp.fromCurrentTime());
        policies.put(policyName, policy);
        putDomainStruct(domainName, domainStruct);
        policy.setAssertions(assertions);
        return true;
    }

    public  FileConnection(File rootDir, File quotaDir);

}