Class CloudStorageRegexFileSet (3.48.0)

public final class CloudStorageRegexFileSet extends GeneratedMessageV3 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 Fields

BUCKET_NAME_FIELD_NUMBER

public static final int BUCKET_NAME_FIELD_NUMBER
Field Value
Type Description
int

EXCLUDE_REGEX_FIELD_NUMBER

public static final int EXCLUDE_REGEX_FIELD_NUMBER
Field Value
Type Description
int

INCLUDE_REGEX_FIELD_NUMBER

public static final int INCLUDE_REGEX_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static CloudStorageRegexFileSet getDefaultInstance()
Returns
Type Description
CloudStorageRegexFileSet

getDescriptor()

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

newBuilder()

public static CloudStorageRegexFileSet.Builder newBuilder()
Returns
Type Description
CloudStorageRegexFileSet.Builder

newBuilder(CloudStorageRegexFileSet prototype)

public static CloudStorageRegexFileSet.Builder newBuilder(CloudStorageRegexFileSet prototype)
Parameter
Name Description
prototype CloudStorageRegexFileSet
Returns
Type Description
CloudStorageRegexFileSet.Builder

parseDelimitedFrom(InputStream input)

public static CloudStorageRegexFileSet parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
CloudStorageRegexFileSet
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CloudStorageRegexFileSet parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CloudStorageRegexFileSet
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static CloudStorageRegexFileSet parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
CloudStorageRegexFileSet
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static CloudStorageRegexFileSet parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CloudStorageRegexFileSet
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static CloudStorageRegexFileSet parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
CloudStorageRegexFileSet
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static CloudStorageRegexFileSet parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CloudStorageRegexFileSet
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static CloudStorageRegexFileSet parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
CloudStorageRegexFileSet
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static CloudStorageRegexFileSet parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CloudStorageRegexFileSet
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static CloudStorageRegexFileSet parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
CloudStorageRegexFileSet
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CloudStorageRegexFileSet parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CloudStorageRegexFileSet
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static CloudStorageRegexFileSet parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
CloudStorageRegexFileSet
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static CloudStorageRegexFileSet parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CloudStorageRegexFileSet
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<CloudStorageRegexFileSet> parser()
Returns
Type Description
Parser<CloudStorageRegexFileSet>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
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

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.

getParserForType()

public Parser<CloudStorageRegexFileSet> getParserForType()
Returns
Type Description
Parser<CloudStorageRegexFileSet>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public CloudStorageRegexFileSet.Builder newBuilderForType()
Returns
Type Description
CloudStorageRegexFileSet.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected CloudStorageRegexFileSet.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
CloudStorageRegexFileSet.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public CloudStorageRegexFileSet.Builder toBuilder()
Returns
Type Description
CloudStorageRegexFileSet.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException