use of software.amazon.awssdk.services.codecommit.model.CreateRepositoryRequest in project aws-doc-sdk-examples by awsdocs.
the class CreateRepository method createRepo.
// snippet-start:[codecommit.java2.create_repo.main]
public static void createRepo(CodeCommitClient codeCommitClient, String repoName) {
try {
CreateRepositoryRequest repositoryRequest = CreateRepositoryRequest.builder().repositoryDescription("Created by the CodeCommit Java API").repositoryName(repoName).build();
CreateRepositoryResponse repositoryResponse = codeCommitClient.createRepository(repositoryRequest);
System.out.println("The ARN of the new repository is " + repositoryResponse.repositoryMetadata().arn());
} catch (CodeCommitException e) {
System.err.println(e.getMessage());
System.exit(1);
}
}
Aggregations