Class StaticFilesHandler.Builder (2.30.0)

public static final class StaticFilesHandler.Builder extends GeneratedMessageV3.Builder<StaticFilesHandler.Builder> implements StaticFilesHandlerOrBuilder

Files served directly to the user for a given URL, such as images, CSS stylesheets, or JavaScript source files. Static file handlers describe which files in the application directory are static files, and which URLs serve them.

Protobuf type google.appengine.v1.StaticFilesHandler

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public StaticFilesHandler build()
Returns
TypeDescription
StaticFilesHandler

buildPartial()

public StaticFilesHandler buildPartial()
Returns
TypeDescription
StaticFilesHandler

clear()

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

clearApplicationReadable()

public StaticFilesHandler.Builder clearApplicationReadable()

Whether files should also be uploaded as code data. By default, files declared in static file handlers are uploaded as static data and are only served to end users; they cannot be read by the application. If enabled, uploads are charged against both your code and static data storage resource quotas.

bool application_readable = 7;

Returns
TypeDescription
StaticFilesHandler.Builder

This builder for chaining.

clearExpiration()

public StaticFilesHandler.Builder clearExpiration()

Time a static file served by this handler should be cached by web proxies and browsers.

.google.protobuf.Duration expiration = 5;

Returns
TypeDescription
StaticFilesHandler.Builder

clearField(Descriptors.FieldDescriptor field)

public StaticFilesHandler.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
StaticFilesHandler.Builder
Overrides

clearHttpHeaders()

public StaticFilesHandler.Builder clearHttpHeaders()
Returns
TypeDescription
StaticFilesHandler.Builder

clearMimeType()

public StaticFilesHandler.Builder clearMimeType()

MIME type used to serve all files served by this handler.

Defaults to file-specific MIME types, which are derived from each file's filename extension.

string mime_type = 4;

Returns
TypeDescription
StaticFilesHandler.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearPath()

public StaticFilesHandler.Builder clearPath()

Path to the static files matched by the URL pattern, from the application root directory. The path can refer to text matched in groupings in the URL pattern.

string path = 1;

Returns
TypeDescription
StaticFilesHandler.Builder

This builder for chaining.

clearRequireMatchingFile()

public StaticFilesHandler.Builder clearRequireMatchingFile()

Whether this handler should match the request if the file referenced by the handler does not exist.

bool require_matching_file = 6;

Returns
TypeDescription
StaticFilesHandler.Builder

This builder for chaining.

clearUploadPathRegex()

public StaticFilesHandler.Builder clearUploadPathRegex()

Regular expression that matches the file paths for all files that should be referenced by this handler.

string upload_path_regex = 2;

Returns
TypeDescription
StaticFilesHandler.Builder

This builder for chaining.

clone()

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

containsHttpHeaders(String key)

public boolean containsHttpHeaders(String key)

HTTP headers to use for all responses from these URLs.

map<string, string> http_headers = 3;

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

getApplicationReadable()

public boolean getApplicationReadable()

Whether files should also be uploaded as code data. By default, files declared in static file handlers are uploaded as static data and are only served to end users; they cannot be read by the application. If enabled, uploads are charged against both your code and static data storage resource quotas.

bool application_readable = 7;

Returns
TypeDescription
boolean

The applicationReadable.

getDefaultInstanceForType()

public StaticFilesHandler getDefaultInstanceForType()
Returns
TypeDescription
StaticFilesHandler

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getExpiration()

public Duration getExpiration()

Time a static file served by this handler should be cached by web proxies and browsers.

.google.protobuf.Duration expiration = 5;

Returns
TypeDescription
Duration

The expiration.

getExpirationBuilder()

public Duration.Builder getExpirationBuilder()

Time a static file served by this handler should be cached by web proxies and browsers.

.google.protobuf.Duration expiration = 5;

Returns
TypeDescription
Builder

getExpirationOrBuilder()

public DurationOrBuilder getExpirationOrBuilder()

Time a static file served by this handler should be cached by web proxies and browsers.

.google.protobuf.Duration expiration = 5;

Returns
TypeDescription
DurationOrBuilder

getHttpHeaders()

public Map<String,String> getHttpHeaders()

Use #getHttpHeadersMap() instead.

Returns
TypeDescription
Map<String,String>

getHttpHeadersCount()

public int getHttpHeadersCount()

HTTP headers to use for all responses from these URLs.

map<string, string> http_headers = 3;

Returns
TypeDescription
int

getHttpHeadersMap()

public Map<String,String> getHttpHeadersMap()

HTTP headers to use for all responses from these URLs.

map<string, string> http_headers = 3;

Returns
TypeDescription
Map<String,String>

getHttpHeadersOrDefault(String key, String defaultValue)

public String getHttpHeadersOrDefault(String key, String defaultValue)

HTTP headers to use for all responses from these URLs.

map<string, string> http_headers = 3;

Parameters
NameDescription
keyString
defaultValueString
Returns
TypeDescription
String

getHttpHeadersOrThrow(String key)

public String getHttpHeadersOrThrow(String key)

HTTP headers to use for all responses from these URLs.

map<string, string> http_headers = 3;

Parameter
NameDescription
keyString
Returns
TypeDescription
String

getMimeType()

public String getMimeType()

MIME type used to serve all files served by this handler.

Defaults to file-specific MIME types, which are derived from each file's filename extension.

string mime_type = 4;

Returns
TypeDescription
String

The mimeType.

getMimeTypeBytes()

public ByteString getMimeTypeBytes()

MIME type used to serve all files served by this handler.

Defaults to file-specific MIME types, which are derived from each file's filename extension.

string mime_type = 4;

Returns
TypeDescription
ByteString

The bytes for mimeType.

getMutableHttpHeaders()

public Map<String,String> getMutableHttpHeaders()

Use alternate mutation accessors instead.

Returns
TypeDescription
Map<String,String>

getPath()

public String getPath()

Path to the static files matched by the URL pattern, from the application root directory. The path can refer to text matched in groupings in the URL pattern.

string path = 1;

Returns
TypeDescription
String

The path.

getPathBytes()

public ByteString getPathBytes()

Path to the static files matched by the URL pattern, from the application root directory. The path can refer to text matched in groupings in the URL pattern.

string path = 1;

Returns
TypeDescription
ByteString

The bytes for path.

getRequireMatchingFile()

public boolean getRequireMatchingFile()

Whether this handler should match the request if the file referenced by the handler does not exist.

bool require_matching_file = 6;

Returns
TypeDescription
boolean

The requireMatchingFile.

getUploadPathRegex()

public String getUploadPathRegex()

Regular expression that matches the file paths for all files that should be referenced by this handler.

string upload_path_regex = 2;

Returns
TypeDescription
String

The uploadPathRegex.

getUploadPathRegexBytes()

public ByteString getUploadPathRegexBytes()

Regular expression that matches the file paths for all files that should be referenced by this handler.

string upload_path_regex = 2;

Returns
TypeDescription
ByteString

The bytes for uploadPathRegex.

hasExpiration()

public boolean hasExpiration()

Time a static file served by this handler should be cached by web proxies and browsers.

.google.protobuf.Duration expiration = 5;

Returns
TypeDescription
boolean

Whether the expiration field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

internalGetMutableMapField(int number)

protected MapField internalGetMutableMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeExpiration(Duration value)

public StaticFilesHandler.Builder mergeExpiration(Duration value)

Time a static file served by this handler should be cached by web proxies and browsers.

.google.protobuf.Duration expiration = 5;

Parameter
NameDescription
valueDuration
Returns
TypeDescription
StaticFilesHandler.Builder

mergeFrom(StaticFilesHandler other)

public StaticFilesHandler.Builder mergeFrom(StaticFilesHandler other)
Parameter
NameDescription
otherStaticFilesHandler
Returns
TypeDescription
StaticFilesHandler.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

public final StaticFilesHandler.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
StaticFilesHandler.Builder
Overrides

putAllHttpHeaders(Map<String,String> values)

public StaticFilesHandler.Builder putAllHttpHeaders(Map<String,String> values)

HTTP headers to use for all responses from these URLs.

map<string, string> http_headers = 3;

Parameter
NameDescription
valuesMap<String,String>
Returns
TypeDescription
StaticFilesHandler.Builder

putHttpHeaders(String key, String value)

public StaticFilesHandler.Builder putHttpHeaders(String key, String value)

HTTP headers to use for all responses from these URLs.

map<string, string> http_headers = 3;

Parameters
NameDescription
keyString
valueString
Returns
TypeDescription
StaticFilesHandler.Builder

removeHttpHeaders(String key)

public StaticFilesHandler.Builder removeHttpHeaders(String key)

HTTP headers to use for all responses from these URLs.

map<string, string> http_headers = 3;

Parameter
NameDescription
keyString
Returns
TypeDescription
StaticFilesHandler.Builder

setApplicationReadable(boolean value)

public StaticFilesHandler.Builder setApplicationReadable(boolean value)

Whether files should also be uploaded as code data. By default, files declared in static file handlers are uploaded as static data and are only served to end users; they cannot be read by the application. If enabled, uploads are charged against both your code and static data storage resource quotas.

bool application_readable = 7;

Parameter
NameDescription
valueboolean

The applicationReadable to set.

Returns
TypeDescription
StaticFilesHandler.Builder

This builder for chaining.

setExpiration(Duration value)

public StaticFilesHandler.Builder setExpiration(Duration value)

Time a static file served by this handler should be cached by web proxies and browsers.

.google.protobuf.Duration expiration = 5;

Parameter
NameDescription
valueDuration
Returns
TypeDescription
StaticFilesHandler.Builder

setExpiration(Duration.Builder builderForValue)

public StaticFilesHandler.Builder setExpiration(Duration.Builder builderForValue)

Time a static file served by this handler should be cached by web proxies and browsers.

.google.protobuf.Duration expiration = 5;

Parameter
NameDescription
builderForValueBuilder
Returns
TypeDescription
StaticFilesHandler.Builder

setField(Descriptors.FieldDescriptor field, Object value)

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

setMimeType(String value)

public StaticFilesHandler.Builder setMimeType(String value)

MIME type used to serve all files served by this handler.

Defaults to file-specific MIME types, which are derived from each file's filename extension.

string mime_type = 4;

Parameter
NameDescription
valueString

The mimeType to set.

Returns
TypeDescription
StaticFilesHandler.Builder

This builder for chaining.

setMimeTypeBytes(ByteString value)

public StaticFilesHandler.Builder setMimeTypeBytes(ByteString value)

MIME type used to serve all files served by this handler.

Defaults to file-specific MIME types, which are derived from each file's filename extension.

string mime_type = 4;

Parameter
NameDescription
valueByteString

The bytes for mimeType to set.

Returns
TypeDescription
StaticFilesHandler.Builder

This builder for chaining.

setPath(String value)

public StaticFilesHandler.Builder setPath(String value)

Path to the static files matched by the URL pattern, from the application root directory. The path can refer to text matched in groupings in the URL pattern.

string path = 1;

Parameter
NameDescription
valueString

The path to set.

Returns
TypeDescription
StaticFilesHandler.Builder

This builder for chaining.

setPathBytes(ByteString value)

public StaticFilesHandler.Builder setPathBytes(ByteString value)

Path to the static files matched by the URL pattern, from the application root directory. The path can refer to text matched in groupings in the URL pattern.

string path = 1;

Parameter
NameDescription
valueByteString

The bytes for path to set.

Returns
TypeDescription
StaticFilesHandler.Builder

This builder for chaining.

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

public StaticFilesHandler.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
StaticFilesHandler.Builder
Overrides

setRequireMatchingFile(boolean value)

public StaticFilesHandler.Builder setRequireMatchingFile(boolean value)

Whether this handler should match the request if the file referenced by the handler does not exist.

bool require_matching_file = 6;

Parameter
NameDescription
valueboolean

The requireMatchingFile to set.

Returns
TypeDescription
StaticFilesHandler.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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

setUploadPathRegex(String value)

public StaticFilesHandler.Builder setUploadPathRegex(String value)

Regular expression that matches the file paths for all files that should be referenced by this handler.

string upload_path_regex = 2;

Parameter
NameDescription
valueString

The uploadPathRegex to set.

Returns
TypeDescription
StaticFilesHandler.Builder

This builder for chaining.

setUploadPathRegexBytes(ByteString value)

public StaticFilesHandler.Builder setUploadPathRegexBytes(ByteString value)

Regular expression that matches the file paths for all files that should be referenced by this handler.

string upload_path_regex = 2;

Parameter
NameDescription
valueByteString

The bytes for uploadPathRegex to set.

Returns
TypeDescription
StaticFilesHandler.Builder

This builder for chaining.