kopia lustrzana https://github.com/gaul/s3proxy
Emit bogus CreationDate when not present
rodzic
869d47a5e1
commit
05b63365bf
|
@ -444,12 +444,16 @@ final class S3ProxyHandler extends AbstractHandler {
|
||||||
xml.writeEndElement();
|
xml.writeEndElement();
|
||||||
|
|
||||||
Date creationDate = metadata.getCreationDate();
|
Date creationDate = metadata.getCreationDate();
|
||||||
if (creationDate != null) {
|
if (creationDate == null) {
|
||||||
|
// Some providers, e.g., Swift, do not provide container
|
||||||
|
// creation date. Emit a bogus one to satisfy clients like
|
||||||
|
// s3cmd which require one.
|
||||||
|
creationDate = new Date(0);
|
||||||
|
}
|
||||||
xml.writeStartElement("CreationDate");
|
xml.writeStartElement("CreationDate");
|
||||||
xml.writeCharacters(blobStore.getContext().utils().date()
|
xml.writeCharacters(blobStore.getContext().utils().date()
|
||||||
.iso8601DateFormat(creationDate).trim());
|
.iso8601DateFormat(creationDate).trim());
|
||||||
xml.writeEndElement();
|
xml.writeEndElement();
|
||||||
}
|
|
||||||
xml.writeEndElement();
|
xml.writeEndElement();
|
||||||
}
|
}
|
||||||
xml.writeEndElement();
|
xml.writeEndElement();
|
||||||
|
|
Ładowanie…
Reference in New Issue