Class CloudStorageRegexFileSet (3.5.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
TypeDescription
int

EXCLUDE_REGEX_FIELD_NUMBER

public static final int EXCLUDE_REGEX_FIELD_NUMBER
Field Value
TypeDescription
int

INCLUDE_REGEX_FIELD_NUMBER

public static final int INCLUDE_REGEX_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static CloudStorageRegexFileSet getDefaultInstance()
Returns
TypeDescription
CloudStorageRegexFileSet

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static CloudStorageRegexFileSet.Builder newBuilder()
Returns
TypeDescription
CloudStorageRegexFileSet.Builder

newBuilder(CloudStorageRegexFileSet prototype)

public static CloudStorageRegexFileSet.Builder newBuilder(CloudStorageRegexFileSet prototype)
Parameter
NameDescription
prototypeCloudStorageRegexFileSet
Returns
TypeDescription
CloudStorageRegexFileSet.Builder

parseDelimitedFrom(InputStream input)

public static CloudStorageRegexFileSet parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
CloudStorageRegexFileSet
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CloudStorageRegexFileSet parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CloudStorageRegexFileSet
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static CloudStorageRegexFileSet parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
CloudStorageRegexFileSet
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static CloudStorageRegexFileSet parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CloudStorageRegexFileSet
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static CloudStorageRegexFileSet parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
CloudStorageRegexFileSet
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static CloudStorageRegexFileSet parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CloudStorageRegexFileSet
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static CloudStorageRegexFileSet parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
CloudStorageRegexFileSet
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static CloudStorageRegexFileSet parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CloudStorageRegexFileSet
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static CloudStorageRegexFileSet parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
CloudStorageRegexFileSet
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CloudStorageRegexFileSet parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CloudStorageRegexFileSet
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static CloudStorageRegexFileSet parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
CloudStorageRegexFileSet
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static CloudStorageRegexFileSet parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CloudStorageRegexFileSet
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<CloudStorageRegexFileSet> parser()
Returns
TypeDescription
Parser<CloudStorageRegexFileSet>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
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

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.

getParserForType()

public Parser<CloudStorageRegexFileSet> getParserForType()
Returns
TypeDescription
Parser<CloudStorageRegexFileSet>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public CloudStorageRegexFileSet.Builder newBuilderForType()
Returns
TypeDescription
CloudStorageRegexFileSet.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected CloudStorageRegexFileSet.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
CloudStorageRegexFileSet.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public CloudStorageRegexFileSet.Builder toBuilder()
Returns
TypeDescription
CloudStorageRegexFileSet.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides Exceptions
TypeDescription
IOException