Class StaticFilesHandler (2.21.0)

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

APPLICATION_READABLE_FIELD_NUMBER

public static final int APPLICATION_READABLE_FIELD_NUMBER
Field Value
TypeDescription
int

EXPIRATION_FIELD_NUMBER

public static final int EXPIRATION_FIELD_NUMBER
Field Value
TypeDescription
int

HTTP_HEADERS_FIELD_NUMBER

public static final int HTTP_HEADERS_FIELD_NUMBER
Field Value
TypeDescription
int

MIME_TYPE_FIELD_NUMBER

public static final int MIME_TYPE_FIELD_NUMBER
Field Value
TypeDescription
int

PATH_FIELD_NUMBER

public static final int PATH_FIELD_NUMBER
Field Value
TypeDescription
int

REQUIRE_MATCHING_FILE_FIELD_NUMBER

public static final int REQUIRE_MATCHING_FILE_FIELD_NUMBER
Field Value
TypeDescription
int

UPLOAD_PATH_REGEX_FIELD_NUMBER

public static final int UPLOAD_PATH_REGEX_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static StaticFilesHandler getDefaultInstance()
Returns
TypeDescription
StaticFilesHandler

getDescriptor()

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

newBuilder()

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

newBuilder(StaticFilesHandler prototype)

public static StaticFilesHandler.Builder newBuilder(StaticFilesHandler prototype)
Parameter
NameDescription
prototypeStaticFilesHandler
Returns
TypeDescription
StaticFilesHandler.Builder

parseDelimitedFrom(InputStream input)

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

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(byte[] data)

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

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteString data)

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

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(CodedInputStream input)

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

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(InputStream input)

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

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteBuffer data)

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

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

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

parser()

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

Methods

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

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

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

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.

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.

getParserForType()

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

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.

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

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.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

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

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

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

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

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

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

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

toBuilder()

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

writeTo(CodedOutputStream output)

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