@@ -0,0 +1,2825 @@
+//snippet-sourcedescription:%5BDeleteQueue.java demonstrates how to delete an Amazon Simple Queue Service queue.%5D%0A//snippet-keyword:%5BSDK for Java 2.0%5D%0A//snippet-keyword:%5BCode Sample%5D%0A//snippet-service:%5BAmazon Simple Queue Service%5D%0A//snippet-sourcetype:%5Bfull-example%5D%0A//snippet-sourcedate:%5B2/20/2020%5D%0A//snippet-sourceauthor:%5Bscmacdon-aws%5D%0A%0A/*%0A * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at:%0A *%0A *    http://aws.amazon.com/apache2.0%0A *%0A * This file is distributed on an %22AS IS%22 BASIS, WITHOUT WARRANTIES%0A * OR CONDITIONS OF ANY KIND, either express or implied. See the%0A * License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0A// snippet-start:%5Bsqs.java2.long_polling.complete%5D%0Apackage com.example.sqs;%0A%0A// snippet-start:%5Bsqs.java2.sqs_example.delete_queue.import%5D%0Aimport software.amazon.awssdk.regions.Region;%0Aimport software.amazon.awssdk.services.sqs.SqsClient;%0Aimport software.amazon.awssdk.services.sqs.model.GetQueueUrlRequest;%0Aimport software.amazon.awssdk.services.sqs.model.DeleteQueueRequest;%0Aimport software.amazon.awssdk.services.sqs.model.QueueNameExistsException;%0A// snippet-end:%5Bsqs.java2.sqs_example.delete_queue.import%5D%0Apublic class DeleteQueue %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A%0A        final String USAGE = %22%5Cn%22 +%0A                %22DeleteQueue - delete a queue%5Cn%5Cn%22 +%0A                %22Usage: DeleteQueue %3CqueueName%3E%5Cn%5Cn%22 +%0A                %22Where:%5Cn%22 +%0A                %22  queueName - the name of the queue.%5Cn%5Cn%22 ;%0A%0A        if (args.length %3C 1) %7B%0A            System.out.println(USAGE);%0A            System.exit(1);%0A        %7D%0A%0A        String queueName = args%5B0%5D;%0A%0A        SqsClient sqs = SqsClient.builder()%0A                .region(Region.US_WEST_2)%0A                .build();%0A%0A        deleteSQSQueue(sqs, queueName);%0A    %7D%0A%0A    // snippet-start:%5Bsqs.java2.sqs_example.delete_queue%5D%0A    public static void deleteSQSQueue(SqsClient sqsClient, String queueName) %7B%0A%0A        try %7B%0A%0A            GetQueueUrlRequest getQueueRequest = GetQueueUrlRequest.builder()%0A                    .queueName(queueName)%0A                    .build();%0A%0A            String queueUrl = sqsClient.getQueueUrl(getQueueRequest).queueUrl();%0A%0A            DeleteQueueRequest deleteQueueRequest = DeleteQueueRequest.builder()%0A                    .queueUrl(queueUrl)%0A                    .build();%0A%0A            sqsClient.deleteQueue(deleteQueueRequest);%0A%0A        %7D catch (QueueNameExistsException e) %7B%0A            e.printStackTrace();%0A            System.exit(1);%0A        %7D%0A        // snippet-end:%5Bsqs.java2.sqs_example.delete_queue%5D%0A    %7D%0A%7D%0A// snippet-end:%5Bsqs.java2.long_polling.complete%5D%0A

Create DeleteQueue.java