> + String streamingUri =
> checkNotNull(from.getFirstHeaderOrNull(CDN_STREAMING_URI), CDN_STREAMING_URI);
> + String iosUri = checkNotNull(from.getFirstHeaderOrNull(CDN_IOS_URI),
> CDN_IOS_URI);
> +
> + if (uri == null) {
> + // CDN is not, and has never, been enabled for this container.
> + return null;
> + }
> + else {
> + String enabled =
> checkNotNull(from.getFirstHeaderOrNull(CDN_ENABLED), CDN_ENABLED);
> + String logRetention =
> checkNotNull(from.getFirstHeaderOrNull(CDN_LOG_RETENTION), CDN_LOG_RETENTION);
> + String ttl = checkNotNull(from.getFirstHeaderOrNull(CDN_TTL),
> CDN_TTL);
> +
> + // just need the name from the path
> + List<String> parts =
> newArrayList(Splitter.on('/').split(request.getEndpoint().getPath()));
> +
> + return CDNContainer.builder().name(parts.get(parts.size() - 1))
Add a `checkArgument(parts.size() > 0)` to make sure this will never fail in an
unexpected way?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/79/files#r9779012