Class CloudStorageRegexFileSet.Builder (3.59.0)

public static final class CloudStorageRegexFileSet.Builder extends GeneratedMessageV3.Builder<CloudStorageRegexFileSet.Builder> implements CloudStorageRegexFileSetOrBuilder

Message representing a set of files in a Cloud Storage bucket. Regular expressions are used to allow fine-grained control over which files in the bucket to include.

Included files are those that match at least one item in include_regex and do not match any items in exclude_regex. Note that a file that matches items from both lists will not be included. For a match to occur, the entire file path (i.e., everything in the url after the bucket name) must match the regular expression.

For example, given the input {bucket_name: "mybucket", include_regex: ["directory1/."], exclude_regex: ["directory1/excluded."]}:

  • gs://mybucket/directory1/myfile will be included
  • gs://mybucket/directory1/directory2/myfile will be included (.* matches across /)
  • gs://mybucket/directory0/directory1/myfile will not be included (the full path doesn't match any items in include_regex)
  • gs://mybucket/directory1/excludedfile will not be included (the path matches an item in exclude_regex)

    If include_regex is left empty, it will match all files by default (this is equivalent to setting include_regex: [".*"]).

    Some other common use cases:

  • {bucket_name: "mybucket", exclude_regex: [".*\.pdf"]} will include all files in mybucket except for .pdf files

  • {bucket_name: "mybucket", include_regex: ["directory/[^/]+"]} will include all files directly under gs://mybucket/directory/, without matching across /

Protobuf type google.privacy.dlp.v2.CloudStorageRegexFileSet

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllExcludeRegex(Iterable<String> values)

public CloudStorageRegexFileSet.Builder addAllExcludeRegex(Iterable<String> values)

A list of regular expressions matching file paths to exclude. All files in the bucket that match at least one of these regular expressions will be excluded from the scan.

Regular expressions use RE2 syntax; a guide can be found under the google/re2 repository on GitHub.

repeated string exclude_regex = 3;

Parameter
Name Description
values Iterable<String>

The excludeRegex to add.

Returns
Type Description
CloudStorageRegexFileSet.Builder

This builder for chaining.

addAllIncludeRegex(Iterable<String> values)

public CloudStorageRegexFileSet.Builder addAllIncludeRegex(Iterable<String> values)

A list of regular expressions matching file paths to include. All files in the bucket that match at least one of these regular expressions will be included in the set of files, except for those that also match an item in exclude_regex. Leaving this field empty will match all files by default (this is equivalent to including .* in the list).

Regular expressions use RE2 syntax; a guide can be found under the google/re2 repository on GitHub.

repeated string include_regex = 2;

Parameter
Name Description
values Iterable<String>

The includeRegex to add.

Returns
Type Description
CloudStorageRegexFileSet.Builder

This builder for chaining.

addExcludeRegex(String value)

public CloudStorageRegexFileSet.Builder addExcludeRegex(String value)

A list of regular expressions matching file paths to exclude. All files in the bucket that match at least one of these regular expressions will be excluded from the scan.

Regular expressions use RE2 syntax; a guide can be found under the google/re2 repository on GitHub.

repeated string exclude_regex = 3;

Parameter
Name Description
value String

The excludeRegex to add.

Returns
Type Description
CloudStorageRegexFileSet.Builder

This builder for chaining.

addExcludeRegexBytes(ByteString value)

public CloudStorageRegexFileSet.Builder addExcludeRegexBytes(ByteString value)

A list of regular expressions matching file paths to exclude. All files in the bucket that match at least one of these regular expressions will be excluded from the scan.

Regular expressions use RE2 syntax; a guide can be found under the google/re2 repository on GitHub.

repeated string exclude_regex = 3;

Parameter
Name Description
value ByteString

The bytes of the excludeRegex to add.

Returns
Type Description
CloudStorageRegexFileSet.Builder

This builder for chaining.

addIncludeRegex(String value)

public CloudStorageRegexFileSet.Builder addIncludeRegex(String value)

A list of regular expressions matching file paths to include. All files in the bucket that match at least one of these regular expressions will be included in the set of files, except for those that also match an item in exclude_regex. Leaving this field empty will match all files by default (this is equivalent to including .* in the list).

Regular expressions use RE2 syntax; a guide can be found under the google/re2 repository on GitHub.

repeated string include_regex = 2;

Parameter
Name Description
value String

The includeRegex to add.

Returns
Type Description
CloudStorageRegexFileSet.Builder

This builder for chaining.

addIncludeRegexBytes(ByteString value)

public CloudStorageRegexFileSet.Builder addIncludeRegexBytes(ByteString value)

A list of regular expressions matching file paths to include. All files in the bucket that match at least one of these regular expressions will be included in the set of files, except for those that also match an item in exclude_regex. Leaving this field empty will match all files by default (this is equivalent to including .* in the list).

Regular expressions use RE2 syntax; a guide can be found under the google/re2 repository on GitHub.

repeated string include_regex = 2;

Parameter
Name Description
value ByteString

The bytes of the includeRegex to add.

Returns
Type Description
CloudStorageRegexFileSet.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public CloudStorageRegexFileSet.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
CloudStorageRegexFileSet.Builder
Overrides

build()

public CloudStorageRegexFileSet build()
Returns
Type Description
CloudStorageRegexFileSet

buildPartial()

public CloudStorageRegexFileSet buildPartial()
Returns
Type Description
CloudStorageRegexFileSet

clear()

public CloudStorageRegexFileSet.Builder clear()
Returns
Type Description
CloudStorageRegexFileSet.Builder
Overrides

clearBucketName()

public CloudStorageRegexFileSet.Builder clearBucketName()

The name of a Cloud Storage bucket. Required.

string bucket_name = 1;

Returns
Type Description
CloudStorageRegexFileSet.Builder

This builder for chaining.

clearExcludeRegex()

public CloudStorageRegexFileSet.Builder clearExcludeRegex()

A list of regular expressions matching file paths to exclude. All files in the bucket that match at least one of these regular expressions will be excluded from the scan.

Regular expressions use RE2 syntax; a guide can be found under the google/re2 repository on GitHub.

repeated string exclude_regex = 3;

Returns
Type Description
CloudStorageRegexFileSet.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public CloudStorageRegexFileSet.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
CloudStorageRegexFileSet.Builder
Overrides

clearIncludeRegex()

public CloudStorageRegexFileSet.Builder clearIncludeRegex()

A list of regular expressions matching file paths to include. All files in the bucket that match at least one of these regular expressions will be included in the set of files, except for those that also match an item in exclude_regex. Leaving this field empty will match all files by default (this is equivalent to including .* in the list).

Regular expressions use RE2 syntax; a guide can be found under the google/re2 repository on GitHub.

repeated string include_regex = 2;

Returns
Type Description
CloudStorageRegexFileSet.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public CloudStorageRegexFileSet.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
CloudStorageRegexFileSet.Builder
Overrides

clone()

public CloudStorageRegexFileSet.Builder clone()
Returns
Type Description
CloudStorageRegexFileSet.Builder
Overrides

getBucketName()

public String getBucketName()

The name of a Cloud Storage bucket. Required.

string bucket_name = 1;

Returns
Type Description
String

The bucketName.

getBucketNameBytes()

public ByteString getBucketNameBytes()

The name of a Cloud Storage bucket. Required.

string bucket_name = 1;

Returns
Type Description
ByteString

The bytes for bucketName.

getDefaultInstanceForType()

public CloudStorageRegexFileSet getDefaultInstanceForType()
Returns
Type Description
CloudStorageRegexFileSet

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getExcludeRegex(int index)

public String getExcludeRegex(int index)

A list of regular expressions matching file paths to exclude. All files in the bucket that match at least one of these regular expressions will be excluded from the scan.

Regular expressions use RE2 syntax; a guide can be found under the google/re2 repository on GitHub.

repeated string exclude_regex = 3;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The excludeRegex at the given index.

getExcludeRegexBytes(int index)

public ByteString getExcludeRegexBytes(int index)

A list of regular expressions matching file paths to exclude. All files in the bucket that match at least one of these regular expressions will be excluded from the scan.

Regular expressions use RE2 syntax; a guide can be found under the google/re2 repository on GitHub.

repeated string exclude_regex = 3;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the excludeRegex at the given index.

getExcludeRegexCount()

public int getExcludeRegexCount()

A list of regular expressions matching file paths to exclude. All files in the bucket that match at least one of these regular expressions will be excluded from the scan.

Regular expressions use RE2 syntax; a guide can be found under the google/re2 repository on GitHub.

repeated string exclude_regex = 3;

Returns
Type Description
int

The count of excludeRegex.

getExcludeRegexList()

public ProtocolStringList getExcludeRegexList()

A list of regular expressions matching file paths to exclude. All files in the bucket that match at least one of these regular expressions will be excluded from the scan.

Regular expressions use RE2 syntax; a guide can be found under the google/re2 repository on GitHub.

repeated string exclude_regex = 3;

Returns
Type Description
ProtocolStringList

A list containing the excludeRegex.

getIncludeRegex(int index)

public String getIncludeRegex(int index)

A list of regular expressions matching file paths to include. All files in the bucket that match at least one of these regular expressions will be included in the set of files, except for those that also match an item in exclude_regex. Leaving this field empty will match all files by default (this is equivalent to including .* in the list).

Regular expressions use RE2 syntax; a guide can be found under the google/re2 repository on GitHub.

repeated string include_regex = 2;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The includeRegex at the given index.

getIncludeRegexBytes(int index)

public ByteString getIncludeRegexBytes(int index)

A list of regular expressions matching file paths to include. All files in the bucket that match at least one of these regular expressions will be included in the set of files, except for those that also match an item in exclude_regex. Leaving this field empty will match all files by default (this is equivalent to including .* in the list).

Regular expressions use RE2 syntax; a guide can be found under the google/re2 repository on GitHub.

repeated string include_regex = 2;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the includeRegex at the given index.

getIncludeRegexCount()

public int getIncludeRegexCount()

A list of regular expressions matching file paths to include. All files in the bucket that match at least one of these regular expressions will be included in the set of files, except for those that also match an item in exclude_regex. Leaving this field empty will match all files by default (this is equivalent to including .* in the list).

Regular expressions use RE2 syntax; a guide can be found under the google/re2 repository on GitHub.

repeated string include_regex = 2;

Returns
Type Description
int

The count of includeRegex.

getIncludeRegexList()

public ProtocolStringList getIncludeRegexList()

A list of regular expressions matching file paths to include. All files in the bucket that match at least one of these regular expressions will be included in the set of files, except for those that also match an item in exclude_regex. Leaving this field empty will match all files by default (this is equivalent to including .* in the list).

Regular expressions use RE2 syntax; a guide can be found under the google/re2 repository on GitHub.

repeated string include_regex = 2;

Returns
Type Description
ProtocolStringList

A list containing the includeRegex.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(CloudStorageRegexFileSet other)

public CloudStorageRegexFileSet.Builder mergeFrom(CloudStorageRegexFileSet other)
Parameter
Name Description
other CloudStorageRegexFileSet
Returns
Type Description
CloudStorageRegexFileSet.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public CloudStorageRegexFileSet.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CloudStorageRegexFileSet.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public CloudStorageRegexFileSet.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
CloudStorageRegexFileSet.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final CloudStorageRegexFileSet.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
CloudStorageRegexFileSet.Builder
Overrides

setBucketName(String value)

public CloudStorageRegexFileSet.Builder setBucketName(String value)

The name of a Cloud Storage bucket. Required.

string bucket_name = 1;

Parameter
Name Description
value String

The bucketName to set.

Returns
Type Description
CloudStorageRegexFileSet.Builder

This builder for chaining.

setBucketNameBytes(ByteString value)

public CloudStorageRegexFileSet.Builder setBucketNameBytes(ByteString value)

The name of a Cloud Storage bucket. Required.

string bucket_name = 1;

Parameter
Name Description
value ByteString

The bytes for bucketName to set.

Returns
Type Description
CloudStorageRegexFileSet.Builder

This builder for chaining.

setExcludeRegex(int index, String value)

public CloudStorageRegexFileSet.Builder setExcludeRegex(int index, String value)

A list of regular expressions matching file paths to exclude. All files in the bucket that match at least one of these regular expressions will be excluded from the scan.

Regular expressions use RE2 syntax; a guide can be found under the google/re2 repository on GitHub.

repeated string exclude_regex = 3;

Parameters
Name Description
index int

The index to set the value at.

value String

The excludeRegex to set.

Returns
Type Description
CloudStorageRegexFileSet.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public CloudStorageRegexFileSet.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
CloudStorageRegexFileSet.Builder
Overrides

setIncludeRegex(int index, String value)

public CloudStorageRegexFileSet.Builder setIncludeRegex(int index, String value)

A list of regular expressions matching file paths to include. All files in the bucket that match at least one of these regular expressions will be included in the set of files, except for those that also match an item in exclude_regex. Leaving this field empty will match all files by default (this is equivalent to including .* in the list).

Regular expressions use RE2 syntax; a guide can be found under the google/re2 repository on GitHub.

repeated string include_regex = 2;

Parameters
Name Description
index int

The index to set the value at.

value String

The includeRegex to set.

Returns
Type Description
CloudStorageRegexFileSet.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public CloudStorageRegexFileSet.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
CloudStorageRegexFileSet.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final CloudStorageRegexFileSet.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
CloudStorageRegexFileSet.Builder
Overrides