Class StaticFilesHandler (2.29.0)

publicfinalclass StaticFilesHandlerextendsGeneratedMessageV3implementsStaticFilesHandlerOrBuilder

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

Inherited Members

com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)

Static Fields

APPLICATION_READABLE_FIELD_NUMBER

publicstaticfinalintAPPLICATION_READABLE_FIELD_NUMBER
Field Value
Type Description
int

EXPIRATION_FIELD_NUMBER

publicstaticfinalintEXPIRATION_FIELD_NUMBER
Field Value
Type Description
int

HTTP_HEADERS_FIELD_NUMBER

publicstaticfinalintHTTP_HEADERS_FIELD_NUMBER
Field Value
Type Description
int

MIME_TYPE_FIELD_NUMBER

publicstaticfinalintMIME_TYPE_FIELD_NUMBER
Field Value
Type Description
int

PATH_FIELD_NUMBER

publicstaticfinalintPATH_FIELD_NUMBER
Field Value
Type Description
int

REQUIRE_MATCHING_FILE_FIELD_NUMBER

publicstaticfinalintREQUIRE_MATCHING_FILE_FIELD_NUMBER
Field Value
Type Description
int

UPLOAD_PATH_REGEX_FIELD_NUMBER

publicstaticfinalintUPLOAD_PATH_REGEX_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

publicstaticStaticFilesHandlergetDefaultInstance()
Returns
Type Description
StaticFilesHandler

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

newBuilder()

publicstaticStaticFilesHandler.BuildernewBuilder()
Returns
Type Description
StaticFilesHandler.Builder

newBuilder(StaticFilesHandler prototype)

publicstaticStaticFilesHandler.BuildernewBuilder(StaticFilesHandlerprototype)
Parameter
Name Description
prototype StaticFilesHandler
Returns
Type Description
StaticFilesHandler.Builder

parseDelimitedFrom(InputStream input)

publicstaticStaticFilesHandlerparseDelimitedFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
StaticFilesHandler
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticStaticFilesHandlerparseDelimitedFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
StaticFilesHandler
Exceptions
Type Description
IOException

parseFrom(byte[] data)

publicstaticStaticFilesHandlerparseFrom(byte[]data)
Parameter
Name Description
data byte[]
Returns
Type Description
StaticFilesHandler
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

publicstaticStaticFilesHandlerparseFrom(byte[]data,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
StaticFilesHandler
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

publicstaticStaticFilesHandlerparseFrom(ByteStringdata)
Parameter
Name Description
data ByteString
Returns
Type Description
StaticFilesHandler
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

publicstaticStaticFilesHandlerparseFrom(ByteStringdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
StaticFilesHandler
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

publicstaticStaticFilesHandlerparseFrom(CodedInputStreaminput)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
StaticFilesHandler
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticStaticFilesHandlerparseFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
StaticFilesHandler
Exceptions
Type Description
IOException

parseFrom(InputStream input)

publicstaticStaticFilesHandlerparseFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
StaticFilesHandler
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticStaticFilesHandlerparseFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
StaticFilesHandler
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

publicstaticStaticFilesHandlerparseFrom(ByteBufferdata)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
StaticFilesHandler
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

publicstaticStaticFilesHandlerparseFrom(ByteBufferdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
StaticFilesHandler
Exceptions
Type Description
InvalidProtocolBufferException

parser()

publicstaticParser<StaticFilesHandler>parser()
Returns
Type Description
Parser<StaticFilesHandler>

Methods

containsHttpHeaders(String key)

publicbooleancontainsHttpHeaders(Stringkey)

HTTP headers to use for all responses from these URLs.

map<string, string> http_headers = 3;

Parameter
Name Description
key String
Returns
Type Description
boolean

equals(Object obj)

publicbooleanequals(Objectobj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getApplicationReadable()

publicbooleangetApplicationReadable()

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
Type Description
boolean

The applicationReadable.

getDefaultInstanceForType()

publicStaticFilesHandlergetDefaultInstanceForType()
Returns
Type Description
StaticFilesHandler

getExpiration()

publicDurationgetExpiration()

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

.google.protobuf.Duration expiration = 5;

Returns
Type Description
Duration

The expiration.

getExpirationOrBuilder()

publicDurationOrBuildergetExpirationOrBuilder()

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

.google.protobuf.Duration expiration = 5;

Returns
Type Description
DurationOrBuilder

getHttpHeaders()

publicMap<String,String>getHttpHeaders()

Use #getHttpHeadersMap() instead.

Returns
Type Description
Map<String,String>

getHttpHeadersCount()

publicintgetHttpHeadersCount()

HTTP headers to use for all responses from these URLs.

map<string, string> http_headers = 3;

Returns
Type Description
int

getHttpHeadersMap()

publicMap<String,String>getHttpHeadersMap()

HTTP headers to use for all responses from these URLs.

map<string, string> http_headers = 3;

Returns
Type Description
Map<String,String>

getHttpHeadersOrDefault(String key, String defaultValue)

publicStringgetHttpHeadersOrDefault(Stringkey,StringdefaultValue)

HTTP headers to use for all responses from these URLs.

map<string, string> http_headers = 3;

Parameters
Name Description
key String
defaultValue String
Returns
Type Description
String

getHttpHeadersOrThrow(String key)

publicStringgetHttpHeadersOrThrow(Stringkey)

HTTP headers to use for all responses from these URLs.

map<string, string> http_headers = 3;

Parameter
Name Description
key String
Returns
Type Description
String

getMimeType()

publicStringgetMimeType()

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
Type Description
String

The mimeType.

getMimeTypeBytes()

publicByteStringgetMimeTypeBytes()

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
Type Description
ByteString

The bytes for mimeType.

getParserForType()

publicParser<StaticFilesHandler>getParserForType()
Returns
Type Description
Parser<StaticFilesHandler>
Overrides

getPath()

publicStringgetPath()

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
Type Description
String

The path.

getPathBytes()

publicByteStringgetPathBytes()

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
Type Description
ByteString

The bytes for path.

getRequireMatchingFile()

publicbooleangetRequireMatchingFile()

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

bool require_matching_file = 6;

Returns
Type Description
boolean

The requireMatchingFile.

getSerializedSize()

publicintgetSerializedSize()
Returns
Type Description
int
Overrides

getUploadPathRegex()

publicStringgetUploadPathRegex()

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

string upload_path_regex = 2;

Returns
Type Description
String

The uploadPathRegex.

getUploadPathRegexBytes()

publicByteStringgetUploadPathRegexBytes()

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

string upload_path_regex = 2;

Returns
Type Description
ByteString

The bytes for uploadPathRegex.

hasExpiration()

publicbooleanhasExpiration()

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

.google.protobuf.Duration expiration = 5;

Returns
Type Description
boolean

Whether the expiration field is set.

hashCode()

publicinthashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapField(int number)

protectedMapFieldinternalGetMapField(intnumber)
Parameter
Name Description
number int
Returns
Type Description
MapField
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

publicStaticFilesHandler.BuildernewBuilderForType()
Returns
Type Description
StaticFilesHandler.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protectedStaticFilesHandler.BuildernewBuilderForType(GeneratedMessageV3.BuilderParentparent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
StaticFilesHandler.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protectedObjectnewInstance(GeneratedMessageV3.UnusedPrivateParameterunused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

publicStaticFilesHandler.BuildertoBuilder()
Returns
Type Description
StaticFilesHandler.Builder

writeTo(CodedOutputStream output)

publicvoidwriteTo(CodedOutputStreamoutput)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.