Cloud Data Loss Prevention (Cloud DLP) ist jetzt Teil des Schutzes sensibler Daten. Der Name der API bleibt unverändert: Cloud Data Loss Prevention API (DLP API). Informationen zu den Diensten, die zum Schutz sensibler Daten gehören, finden Sie unter Schutz sensibler Daten.
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Dieses Codebeispiel zeigt, wie Sie Details aus Inspektionsergebnissen extrahieren, die im Protobuf-Textformat gespeichert sind. Führen Sie diese Aufgabe aus, wenn Sie die Ergebnisse der Überprüfung in Cloud Storage gespeichert haben.
In diesem Beispiel wird das exportierte SaveToGcsFindingsOutput-Objekt in ein für Menschen lesbares Format konvertiert. Sie können die Ausgabe dann verwenden, um einzelne Inspektionsergebnisse zu analysieren.
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());}}}
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-19 (UTC)."],[],[],null,[]]