File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/main/java/software/amazon/encryption/s3 Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -216,16 +216,16 @@ public static Consumer<AwsRequestOverrideConfiguration.Builder> withAdditionalCo
216216 * @throws S3EncryptionClientException if the new keyring has the same materials description as the current one
217217 */
218218 public ReEncryptInstructionFileResponse reEncryptInstructionFile (ReEncryptInstructionFileRequest reEncryptInstructionFileRequest ) {
219+ if (!_instructionFileConfig .isInstructionFilePutEnabled ()) {
220+ throw new S3EncryptionClientException ("Instruction file put operations must be enabled to re-encrypt instruction files" );
221+ }
222+
219223 //Build request to retrieve the encrypted object and its associated instruction file
220224 final GetObjectRequest request = GetObjectRequest .builder ()
221225 .bucket (reEncryptInstructionFileRequest .bucket ())
222226 .key (reEncryptInstructionFileRequest .key ())
223227 .build ();
224228
225- if (!_instructionFileConfig .isInstructionFilePutEnabled ()) {
226- throw new S3EncryptionClientException ("Instruction file put operations must be enabled to re-encrypt instruction files" );
227- }
228-
229229 ResponseInputStream <GetObjectResponse > response = this .getObject (request );
230230 ContentMetadataDecodingStrategy decodingStrategy = new ContentMetadataDecodingStrategy (_instructionFileConfig );
231231 ContentMetadata contentMetadata = decodingStrategy .decode (request , response .response ());
You can’t perform that action at this time.
0 commit comments