class CloudnamePath {

    public boolean isSubpathOf(final CloudnamePath other) {
        if (other == null) {
            return false;
        }
        if (this.pathElements.length > other.pathElements.length) {
            return false;
        }

        if (this.pathElements.length == 0) {
            // This is an empty path. It is the subpath of any other path.
            return true;
        }

        for (int i = 0; i < this.pathElements.length; i++) {
            if (!other.pathElements[i].equals(this.pathElements[i])) {
                return false;
            }
        }

        return true;
    }

    public  CloudnamePath(final String[] pathElements);
    public  CloudnamePath(final CloudnamePath path, final String additionalElement);

}