1010// </snippet_imports>
1111
1212/**
13- * 1. Obtain Azure Face resource
14- * 2. Ensure correct Java version, ex: Java 8 or later
15- * 3. Follow IDE or command line instruction
16- * For Maven: install and configure - https://maven.apache.org/install.html
17- * - To list dependencies for this sample, execute from command line: mvn dependency:list
18- * - From ModerateImages folder: mvn compile exec:java -Dexec.cleanupDaemonThreads=false
19- * 4. Add your Face subscription key and endpoint region (replace 'westus', if necessary)
13+ * Prerequisites:
14+ * 1. Obtain an Azure Content Moderator resource
15+ * 2. Clone or download this repo: https://github.com/Azure-Samples/cognitive-services-java-sdk-samples.git
16+ * 3. Use Java 8 or later
17+ * 4. Set and add your Content Moderator subscription key and endpoint environment variables in the authenticate section below.
18+ *
19+ * How to run:
20+ * Run in your favorite IDE or...
21+ * To use the command line:
22+ * - Make sure Maven is installed: https://maven.apache.org/install.html
23+ * - Run from the ContentModerator folder: mvn compile exec:java -Dexec.cleanupDaemonThreads=false
24+ * - All dependencies will be automatically included. To list them (if desired): mvn dependency:list
2025 *
2126 * This sample reads two URL images from file, then moderates them. A successful response shows
2227 * a JSON representation of the moderation results.
@@ -43,11 +48,11 @@ public static void main(String[] args) {
4348 /**
4449 * Authenticate
4550 */
46- // Create a variable called AZURE_CONTENTMODERATOR_KEY in your environment settings, with your key as its value.
47- // Replace the first part ("westus") with your own, if needed.
51+ // Create a variable called CONTENT_MODERATOR_SUBSCRIPTION_KEY in your environment settings, with your key as its value.
52+ // Create an endpoint environment variables too, replace the first part ("westus") with your own, if needed.
4853 ContentModeratorClient client = ContentModeratorManager
4954 .authenticate (new AzureRegionBaseUrl ()
50- .fromString ("https://westus.api.cognitive.microsoft.com " ), System .getenv ("AZURE_CONTENTMODERATOR_KEY " ));
55+ .fromString ("CONTENT_MODERATOR_ENDPOINT " ), System .getenv ("CONTENT_MODERATOR_SUBSCRIPTION_KEY " ));
5156 // </snippet_client>
5257
5358 // <snippet_imagemod_iterate
0 commit comments