Class StaticFilesHandler

  • All Implemented Interfaces:
    StaticFilesHandlerOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

    public final class StaticFilesHandler
    extends com.google.protobuf.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
    See Also:
    Serialized Form
    • Field Detail

      • UPLOAD_PATH_REGEX_FIELD_NUMBER

        public static final int UPLOAD_PATH_REGEX_FIELD_NUMBER
        See Also:
        Constant Field Values
      • HTTP_HEADERS_FIELD_NUMBER

        public static final int HTTP_HEADERS_FIELD_NUMBER
        See Also:
        Constant Field Values
      • EXPIRATION_FIELD_NUMBER

        public static final int EXPIRATION_FIELD_NUMBER
        See Also:
        Constant Field Values
      • REQUIRE_MATCHING_FILE_FIELD_NUMBER

        public static final int REQUIRE_MATCHING_FILE_FIELD_NUMBER
        See Also:
        Constant Field Values
      • APPLICATION_READABLE_FIELD_NUMBER

        public static final int APPLICATION_READABLE_FIELD_NUMBER
        See Also:
        Constant Field Values
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetMapField

        protected com.google.protobuf.MapField internalGetMapField​(int number)
        Overrides:
        internalGetMapField in class com.google.protobuf.GeneratedMessageV3
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • 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;
        Specified by:
        getPath in interface StaticFilesHandlerOrBuilder
        Returns:
        The path.
      • getPathBytes

        public com.google.protobuf.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;
        Specified by:
        getPathBytes in interface StaticFilesHandlerOrBuilder
        Returns:
        The bytes for path.
      • 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;
        Specified by:
        getUploadPathRegex in interface StaticFilesHandlerOrBuilder
        Returns:
        The uploadPathRegex.
      • getUploadPathRegexBytes

        public com.google.protobuf.ByteString getUploadPathRegexBytes()
         Regular expression that matches the file paths for all files that should be
         referenced by this handler.
         
        string upload_path_regex = 2;
        Specified by:
        getUploadPathRegexBytes in interface StaticFilesHandlerOrBuilder
        Returns:
        The bytes for uploadPathRegex.
      • 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;
        Specified by:
        getMimeType in interface StaticFilesHandlerOrBuilder
        Returns:
        The mimeType.
      • getMimeTypeBytes

        public com.google.protobuf.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;
        Specified by:
        getMimeTypeBytes in interface StaticFilesHandlerOrBuilder
        Returns:
        The bytes for mimeType.
      • 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;
        Specified by:
        hasExpiration in interface StaticFilesHandlerOrBuilder
        Returns:
        Whether the expiration field is set.
      • getExpiration

        public com.google.protobuf.Duration getExpiration()
         Time a static file served by this handler should be cached
         by web proxies and browsers.
         
        .google.protobuf.Duration expiration = 5;
        Specified by:
        getExpiration in interface StaticFilesHandlerOrBuilder
        Returns:
        The expiration.
      • getExpirationOrBuilder

        public com.google.protobuf.DurationOrBuilder getExpirationOrBuilder()
         Time a static file served by this handler should be cached
         by web proxies and browsers.
         
        .google.protobuf.Duration expiration = 5;
        Specified by:
        getExpirationOrBuilder in interface StaticFilesHandlerOrBuilder
      • 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;
        Specified by:
        getRequireMatchingFile in interface StaticFilesHandlerOrBuilder
        Returns:
        The requireMatchingFile.
      • 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;
        Specified by:
        getApplicationReadable in interface StaticFilesHandlerOrBuilder
        Returns:
        The applicationReadable.
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static StaticFilesHandler parseFrom​(ByteBuffer data)
                                            throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static StaticFilesHandler parseFrom​(ByteBuffer data,
                                                   com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                            throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static StaticFilesHandler parseFrom​(com.google.protobuf.ByteString data)
                                            throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static StaticFilesHandler parseFrom​(com.google.protobuf.ByteString data,
                                                   com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                            throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static StaticFilesHandler parseFrom​(byte[] data)
                                            throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static StaticFilesHandler parseFrom​(byte[] data,
                                                   com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                            throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static StaticFilesHandler parseFrom​(com.google.protobuf.CodedInputStream input,
                                                   com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                            throws IOException
        Throws:
        IOException
      • newBuilderForType

        public StaticFilesHandler.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public StaticFilesHandler.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected StaticFilesHandler.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getParserForType

        public com.google.protobuf.Parser<StaticFilesHandler> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public StaticFilesHandler getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder