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
EXCLUDE_REGEX_FIELD_NUMBER
public static final int EXCLUDE_REGEX_FIELD_NUMBER
Field Value
INCLUDE_REGEX_FIELD_NUMBER
public static final int INCLUDE_REGEX_FIELD_NUMBER
Field Value
Static Methods
getDefaultInstance()
public static CloudStorageRegexFileSet getDefaultInstance()
Returns
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns
newBuilder()
public static CloudStorageRegexFileSet.Builder newBuilder()
Returns
newBuilder(CloudStorageRegexFileSet prototype)
public static CloudStorageRegexFileSet.Builder newBuilder(CloudStorageRegexFileSet prototype)
Parameter
Returns
public static CloudStorageRegexFileSet parseDelimitedFrom(InputStream input)
Parameter
Returns
Exceptions
public static CloudStorageRegexFileSet parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(byte[] data)
public static CloudStorageRegexFileSet parseFrom(byte[] data)
Parameter
Name | Description |
data | byte[]
|
Returns
Exceptions
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static CloudStorageRegexFileSet parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteString data)
public static CloudStorageRegexFileSet parseFrom(ByteString data)
Parameter
Returns
Exceptions
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static CloudStorageRegexFileSet parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static CloudStorageRegexFileSet parseFrom(CodedInputStream input)
Parameter
Returns
Exceptions
public static CloudStorageRegexFileSet parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static CloudStorageRegexFileSet parseFrom(InputStream input)
Parameter
Returns
Exceptions
public static CloudStorageRegexFileSet parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteBuffer data)
public static CloudStorageRegexFileSet parseFrom(ByteBuffer data)
Parameter
Returns
Exceptions
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static CloudStorageRegexFileSet parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parser()
public static Parser<CloudStorageRegexFileSet> parser()
Returns
Methods
equals(Object obj)
public boolean equals(Object obj)
Parameter
Returns
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
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
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
getParserForType()
public Parser<CloudStorageRegexFileSet> getParserForType()
Returns
Overrides
getSerializedSize()
public int getSerializedSize()
Returns
Overrides
getUnknownFields()
public final UnknownFieldSet getUnknownFields()
Returns
Overrides
hashCode()
Returns
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Overrides
isInitialized()
public final boolean isInitialized()
Returns
Overrides
newBuilderForType()
public CloudStorageRegexFileSet.Builder newBuilderForType()
Returns
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected CloudStorageRegexFileSet.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Returns
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Returns
Overrides
toBuilder()
public CloudStorageRegexFileSet.Builder toBuilder()
Returns
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Parameter
Overrides
Exceptions