> @@ -80,6 +80,23 @@
> @Fallback(NullOnNotFoundOr404.class)
> @Path("/")
> @Nullable
> + ObjectList list();
> +
> + /**
> + * Lists up to 10,000 objects.
> + *
> + * @param options
> + * the {@link ListContainerOptions} for controlling the
> returned list.
> + *
> + * @return an {@link ObjectList} of {@link SwiftObject} ordered by name
> or {@code null}.
> + */
> + @Named("object:list")
> + @GET
> + @QueryParams(keys = "format", values = "json")
> + @ResponseParser(ParseObjectListFromResponse.class)
> + @Fallback(NullOnNotFoundOr404.class)
It is actually a
[List](https://github.com/rackerlabs/jclouds-labs-openstack/blob/api-updates/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/domain/ObjectList.java#L34),
as it extends `ForwardingList`. As its javadoc says, it represents a list of
objects in a container.
So what does a `404` mean in this case? One could assume that containers should
already exist, as you get this api with something like:
`api.objectApiInRegionForContainer("DFW", "myContainer")`.
* If the container exists when calling the `list` method, I think the method
should return the `ObjectList` instance with the `container` variable set with
the container details, and the `objects` one set to an empty list.
* If the container does not exist, I think we should propagate an exception, as
returning `null` is very ambiguous (what does `null` mean in this case? This is
one of the reasons jclouds avoids using `null` for lists).
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/89/files#r11250700