importcom.google.privacy.dlp.v2.Finding;importcom.google.privacy.dlp.v2.SaveToGcsFindingsOutput;importcom.google.protobuf.ByteString;importcom.google.protobuf.TextFormat;importjava.io.FileInputStream;importjava.io.IOException;importjava.io.InputStreamReader;importjava.io.Reader;importjava.nio.charset.StandardCharsets;publicclassProcessInspectFindingsSavedToGcs{publicstaticvoidmain(String[]args)throwsException{// TODO(developer): Replace these variables before running the sample.StringinputPath="src/test/resources/save_to_gcs_findings.txt";processFindingsGcsFile(inputPath);}// Processes a file containing findings from a DLP inspect job.publicstaticvoidprocessFindingsGcsFile(StringinputPath)throwsIOException{SaveToGcsFindingsOutput.Builderbuilder=SaveToGcsFindingsOutput.newBuilder();try(Readerreader=newInputStreamReader(newFileInputStream(inputPath),StandardCharsets.UTF_8)){TextFormat.merge(reader,builder);}SaveToGcsFindingsOutputoutput=builder.build();// Parse the converted proto and process resultsSystem.out.println("Findings: "+output.getFindingsCount());for(Findingf:output.getFindingsList()){System.out.println("\tInfo type: "+f.getInfoType().getName());System.out.println("\tLikelihood: "+f.getLikelihood());}}}