Class ContentMetadataDecodingStrategy
- java.lang.Object
-
- software.amazon.encryption.s3.internal.ContentMetadataDecodingStrategy
-
public class ContentMetadataDecodingStrategy extends Object
-
-
Constructor Summary
Constructors Constructor Description ContentMetadataDecodingStrategy(InstructionFileConfig instructionFileConfig)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ContentMetadatadecode(software.amazon.awssdk.services.s3.model.GetObjectRequest request, software.amazon.awssdk.services.s3.model.GetObjectResponse response)ContentMetadatadecodeV1V2FromInstructionFile(software.amazon.awssdk.services.s3.model.GetObjectRequest request, software.amazon.awssdk.services.s3.model.GetObjectResponse response)Decodes V1/V2 format from instruction file.ContentMetadatadecodeV3FromInstructionFile(software.amazon.awssdk.services.s3.model.GetObjectRequest request, software.amazon.awssdk.services.s3.model.GetObjectResponse response)Decodes V3 format from instruction file.static booleanisV1V2InObjectMetadata(Map<String,String> objectMetadata)Determines if V1/V2 format is present in object metadata.static booleanisV3InInstructionFile(Map<String,String> objectMetadata)Determines if V3 format uses instruction file.static booleanisV3InObjectMetadata(Map<String,String> objectMetadata)Determines if V3 format is present in object metadata.Map<String,String>loadInstructionFileMetadata(software.amazon.awssdk.services.s3.model.GetObjectRequest request)Loads metadata from the instruction file and returns it as a map.
-
-
-
Constructor Detail
-
ContentMetadataDecodingStrategy
public ContentMetadataDecodingStrategy(InstructionFileConfig instructionFileConfig)
-
-
Method Detail
-
loadInstructionFileMetadata
public Map<String,String> loadInstructionFileMetadata(software.amazon.awssdk.services.s3.model.GetObjectRequest request)
Loads metadata from the instruction file and returns it as a map.- Parameters:
request- the original GetObject request- Returns:
- the metadata map loaded from the instruction file
- Throws:
S3EncryptionClientException- if the instruction file cannot be loaded or parsed
-
isV1V2InObjectMetadata
public static boolean isV1V2InObjectMetadata(Map<String,String> objectMetadata)
Determines if V1/V2 format is present in object metadata. All V1/V2 keys must be present in object metadata.
-
isV3InObjectMetadata
public static boolean isV3InObjectMetadata(Map<String,String> objectMetadata)
Determines if V3 format is present in object metadata. "x-amz-c" and "x-amz-d" and "x-amz-i" keys are always in object metadata, and "x-amz-3" is also in object metadata.
-
isV3InInstructionFile
public static boolean isV3InInstructionFile(Map<String,String> objectMetadata)
Determines if V3 format uses instruction file. "x-amz-c" and "x-amz-d" and "x-amz-i" are in object metadata, but "x-amz-3" is not present (must be in instruction file).
-
decodeV1V2FromInstructionFile
public ContentMetadata decodeV1V2FromInstructionFile(software.amazon.awssdk.services.s3.model.GetObjectRequest request, software.amazon.awssdk.services.s3.model.GetObjectResponse response)
Decodes V1/V2 format from instruction file. No V1/V2 keys in object metadata, all keys are in instruction file.
-
decodeV3FromInstructionFile
public ContentMetadata decodeV3FromInstructionFile(software.amazon.awssdk.services.s3.model.GetObjectRequest request, software.amazon.awssdk.services.s3.model.GetObjectResponse response)
Decodes V3 format from instruction file. c/d/i keys are in object metadata, x-amz-3 and other keys are in instruction file.
-
decode
public ContentMetadata decode(software.amazon.awssdk.services.s3.model.GetObjectRequest request, software.amazon.awssdk.services.s3.model.GetObjectResponse response)
-
-