All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.uid2.shared.store.scope.SiteScope Maven / Gradle / Ivy

package com.uid2.shared.store.scope;


import com.uid2.shared.store.CloudPath;

public class SiteScope implements StoreScope {
    public SiteScope(CloudPath rootMetadataPath, Integer siteId){
        this.rootMetadataPath = rootMetadataPath;
        this.siteId = siteId;
    }
    private final Integer siteId;
    private final CloudPath rootMetadataPath;

    @Override
    public CloudPath getMetadataPath() {
        return resolve(rootMetadataPath.getFileName());
    }

    @Override
    public CloudPath resolve(CloudPath cloudPath) {
        CloudPath directory = rootMetadataPath.getParent();
        return directory.resolve("site").resolve(siteId.toString()).resolve(cloudPath);
    }

    @Override
    public Integer getId() {
        return siteId;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy