Skip to content

Commit

Permalink
Restrict display of metadata to keys x-amz-meta-*.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkocher committed Feb 13, 2024
1 parent f7977d0 commit 51d46a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Expand Up @@ -75,7 +75,7 @@ public String getDescription() {
});
}
}
final Map<String, String> metadata = Maps.transformValues(object.getModifiableMetadata(), Object::toString);
final Map<String, String> metadata = Maps.transformValues(object.getUserMetadataMap(), Object::toString);
if(!metadata.isEmpty()) {
attributes.setMetadata(metadata);
}
Expand Down
Expand Up @@ -41,7 +41,7 @@ public class S3TimestampFeatureTest extends AbstractS3Test {

@Test
public void testFindTimestamp() throws Exception {
final Path bucket = new Path("test-eu-central-1-cyberduck", EnumSet.of(Path.Type.volume, Path.Type.directory));
final Path bucket = new Path("versioning-test-eu-central-1-cyberduck", EnumSet.of(Path.Type.volume, Path.Type.directory));
final TransferStatus status = new TransferStatus();
final S3AccessControlListFeature acl = new S3AccessControlListFeature(session);
final Path test = new S3TouchFeature(session, acl).touch(new Path(bucket,
Expand All @@ -57,6 +57,9 @@ public void testFindTimestamp() throws Exception {
final S3TimestampFeature feature = new S3TimestampFeature(session);
feature.setTimestamp(test, new TransferStatus().withModified(1630305150672L).withCreated(1530305160672L));
final PathAttributes attributesAfterSettingNewTimestamps = new S3AttributesFinderFeature(session, acl).find(test);
assertEquals(2, attributesAfterSettingNewTimestamps.getMetadata().size());
assertEquals(new S3MetadataFeature(session, acl).getMetadata(test), attributesAfterSettingNewTimestamps.getMetadata());
assertEquals(new S3AttributesFinderFeature(session, acl).find(test).getVersionId(), attributesAfterSettingNewTimestamps.getVersionId());
assertEquals(1630305150000L, attributesAfterSettingNewTimestamps.getModificationDate());
assertEquals(1530305160000L, attributesAfterSettingNewTimestamps.getCreationDate());
test.attributes().setModificationDate(1630305150000L);
Expand Down

0 comments on commit 51d46a0

Please sign in to comment.