use of software.amazon.awssdk.regions.Region in project aws-doc-sdk-examples by awsdocs.
the class ListFacesInCollection method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + "ListFacesInCollection <collectionId>\n\n" + "Where:\n" + "collectionId - the name of the collection. \n\n";
if (args.length < 1) {
System.out.println(USAGE);
System.exit(1);
}
String collectionId = args[0];
Region region = Region.US_EAST_1;
RekognitionClient rekClient = RekognitionClient.builder().region(region).build();
System.out.println("Faces in collection " + collectionId);
listFacesCollection(rekClient, collectionId);
rekClient.close();
}
use of software.amazon.awssdk.regions.Region in project aws-doc-sdk-examples by awsdocs.
the class RecognizeCelebrities method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + " <sourceImage>\n\n" + "Where:\n" + " sourceImage - the path to the image (for example, C:\\AWS\\pic1.png). \n\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String sourceImage = args[0];
Region region = Region.US_EAST_1;
RekognitionClient rekClient = RekognitionClient.builder().region(region).build();
System.out.println("Locating celebrities in " + sourceImage);
recognizeAllCelebrities(rekClient, sourceImage);
rekClient.close();
}
use of software.amazon.awssdk.regions.Region in project aws-doc-sdk-examples by awsdocs.
the class VideoCelebrityDetection method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + " <bucket> <video> <topicArn> <roleArn>\n\n" + "Where:\n" + " bucket - the name of the bucket in which the video is located (for example, (for example, myBucket). \n\n" + " video - the name of video (for example, people.mp4). \n\n" + " topicArn - the ARN of the Amazon Simple Notification Service (Amazon SNS) topic. \n\n" + " roleArn - the ARN of the AWS Identity and Access Management (IAM) role to use. \n\n";
if (args.length != 4) {
System.out.println(USAGE);
System.exit(1);
}
String bucket = args[0];
String video = args[1];
String topicArn = args[2];
String roleArn = args[3];
Region region = Region.US_EAST_1;
RekognitionClient rekClient = RekognitionClient.builder().region(region).build();
NotificationChannel channel = NotificationChannel.builder().snsTopicArn(topicArn).roleArn(roleArn).build();
StartCelebrityDetection(rekClient, channel, bucket, video);
GetCelebrityDetectionResults(rekClient);
System.out.println("This example is done!");
rekClient.close();
}
use of software.amazon.awssdk.regions.Region in project aws-doc-sdk-examples by awsdocs.
the class DeleteObjects method main.
public static void main(String[] args) {
final String USAGE = "\n" + "To run this example, supply the name of an S3 bucket and at least\n" + "one object name (key) to delete.\n" + "\n" + "Ex: <bucketName> <objectName>\n";
if (args.length != 2) {
System.out.println(USAGE);
System.exit(1);
}
String bucketName = args[0];
String objectName = args[1];
System.out.println("Deleting an object from the Amazon S3 bucket: " + bucketName);
Region region = Region.US_WEST_2;
S3Client s3 = S3Client.builder().region(region).build();
deleteBucketObjects(s3, bucketName, objectName);
s3.close();
}
use of software.amazon.awssdk.regions.Region in project aws-doc-sdk-examples by awsdocs.
the class GetObjectPresignedUrl method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " GetObjectPresignedUrl <bucketName> <keyName> \n\n" + "Where:\n" + " bucketName - the Amazon S3 bucket name. \n\n" + " keyName - a key name that represents a text file. \n\n";
if (args.length != 2) {
System.out.println(USAGE);
System.exit(1);
}
String bucketName = args[0];
String keyName = args[1];
Region region = Region.US_WEST_2;
S3Presigner presigner = S3Presigner.builder().region(region).build();
getPresignedUrl(presigner, bucketName, keyName);
presigner.close();
}
Aggregations