Skip to content

osclient.objectStorage().objects().get(containerName, name) doesn't seem to parse ETag #944

@gonewest818

Description

@gonewest818

Using the version 3.0.3, I am getting different swift objects from osclient.objectStorage().objects().list(containerName) versus osclient.objectStorage().objects().get(containerName, name) in that the former gives me a list of SwiftObjectImpl containing ETag, wheres the latter gives me a single SwiftObjectImpl with no ETag. In this particular use case I only want the ETag for the individual file I am downloading with get, so it's unfortunate that the ETag isn't there.

The SwiftObjectImpl in the get() case is being built in an apply method on the ParseObjectFunction:

@Override
public SwiftObject apply(HttpResponse resp) {
    return SwiftObjectImpl.builder()
              .name(location.getObjectName())
              .containerName(location.getContainerName())
              .mimeType(resp.header(CONTENT_TYPE))
              .sizeBytes(asLong(resp.header(CONTENT_LENGTH)))
              .metadata(MapWithoutMetaPrefixFunction.INSTANCE.apply(resp.headers()))
              .lastModified(Parser.toRFC822DateParse(resp.header(LAST_MODIFIED)))
              .build();

which includes explicit handling of content type and content length, but it seems to me it's just not handling etags.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions