Class CloudStorageRegexFileSet.Builder (3.22.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
TypeDescription
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
NameDescription
valuesIterable<String>

The excludeRegex to add.

Returns
TypeDescription
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
NameDescription
valuesIterable<String>

The includeRegex to add.

Returns
TypeDescription
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
NameDescription
valueString

The excludeRegex to add.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes of the excludeRegex to add.

Returns
TypeDescription
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
NameDescription
valueString

The includeRegex to add.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes of the includeRegex to add.

Returns
TypeDescription
CloudStorageRegexFileSet.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public CloudStorageRegexFileSet.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
CloudStorageRegexFileSet.Builder
Overrides

build()

public CloudStorageRegexFileSet build()
Returns
TypeDescription
CloudStorageRegexFileSet

buildPartial()

public CloudStorageRegexFileSet buildPartial()
Returns
TypeDescription
CloudStorageRegexFileSet

clear()

public CloudStorageRegexFileSet.Builder clear()
Returns
TypeDescription
CloudStorageRegexFileSet.Builder
Overrides

clearBucketName()

public CloudStorageRegexFileSet.Builder clearBucketName()

The name of a Cloud Storage bucket. Required.

string bucket_name = 1;

Returns
TypeDescription
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
TypeDescription
CloudStorageRegexFileSet.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public CloudStorageRegexFileSet.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
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
TypeDescription
CloudStorageRegexFileSet.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public CloudStorageRegexFileSet.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
CloudStorageRegexFileSet.Builder
Overrides

clone()

public CloudStorageRegexFileSet.Builder clone()
Returns
TypeDescription
CloudStorageRegexFileSet.Builder
Overrides

getBucketName()

public String getBucketName()

The name of a Cloud Storage bucket. Required.

string bucket_name = 1;

Returns
TypeDescription
String

The bucketName.

getBucketNameBytes()

public ByteString getBucketNameBytes()

The name of a Cloud Storage bucket. Required.

string bucket_name = 1;

Returns
TypeDescription
ByteString

The bytes for bucketName.

getDefaultInstanceForType()

public CloudStorageRegexFileSet getDefaultInstanceForType()
Returns
TypeDescription
CloudStorageRegexFileSet

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
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
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
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
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
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
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
ProtocolStringList

A list containing the includeRegex.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(CloudStorageRegexFileSet other)

public CloudStorageRegexFileSet.Builder mergeFrom(CloudStorageRegexFileSet other)
Parameter
NameDescription
otherCloudStorageRegexFileSet
Returns
TypeDescription
CloudStorageRegexFileSet.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public CloudStorageRegexFileSet.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CloudStorageRegexFileSet.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public CloudStorageRegexFileSet.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
CloudStorageRegexFileSet.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final CloudStorageRegexFileSet.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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
NameDescription
valueString

The bucketName to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for bucketName to set.

Returns
TypeDescription
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
NameDescription
indexint

The index to set the value at.

valueString

The excludeRegex to set.

Returns
TypeDescription
CloudStorageRegexFileSet.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public CloudStorageRegexFileSet.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
indexint

The index to set the value at.

valueString

The includeRegex to set.

Returns
TypeDescription
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
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
CloudStorageRegexFileSet.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final CloudStorageRegexFileSet.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
CloudStorageRegexFileSet.Builder
Overrides