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

org.openstack4j.model.storage.object.options.ObjectLocation Maven / Gradle / Ivy

There is a newer version: 3.2.0
Show newest version
package org.openstack4j.model.storage.object.options;

import static com.google.common.base.Preconditions.checkNotNull;

/**
 * Holds location information for an Object (Container and Object name including path)
 * 
 * @author Jeremy Unruh
 */
public final class ObjectLocation {

    private String containerName;
    private String objectName;
    
    
    private ObjectLocation(String containerName, String objectName) {
        super();
        checkNotNull(containerName, "ContainerName cannot be null");
        checkNotNull(objectName, "ObjectName cannot be null");

        this.containerName = containerName;
        this.objectName = objectName;
    }
    
    public static ObjectLocation create(String containerName, String objectName) {
        return new ObjectLocation(containerName, objectName);
    }

    public String getContainerName() {
        return containerName;
    }

    public String getObjectName() {
        return objectName;
    }
    
    public String getURI() {
        return String.format("/%s/%s", containerName, objectName);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy