Skip to content

Commit

Permalink
Seperate API call from response processing.
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtisvg committed Nov 7, 2018
1 parent df1d698 commit 89cec0b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion dlp/src/main/java/dlp/snippets/InspectFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ public static void inspectFile(String projectId, String filePath, String fileTyp
.setInspectConfig(config)
.build();

// Use the client to send the request and parse results
// Use the client to send the API request
InspectContentResponse response = dlp.inspectContent(request);

// Parse the response and process results
System.out.println("Findings: " + response.getResult().getFindingsCount());
for (Finding f : response.getResult().getFindingsList()) {
System.out.println("\tQuote: " + f.getQuote());
Expand Down
4 changes: 3 additions & 1 deletion dlp/src/main/java/dlp/snippets/InspectString.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ public static void inspectString(String projectId, String textToInspect) {
.setInspectConfig(config)
.build();

// Run request and parse response
// Use the client to send the API request
InspectContentResponse response = dlp.inspectContent(request);

// Parse the response and process results
System.out.println("Findings: " + response.getResult().getFindingsCount());
for (Finding f : response.getResult().getFindingsList()) {
System.out.println("\tQuote: " + f.getQuote());
Expand Down

0 comments on commit 89cec0b

Please sign in to comment.