Interface BlobstoreService


@Deprecated(since="3.0.0") public interface BlobstoreService
Deprecated.
as of version 3.0, use BlobstoreService instead.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated.
    Create a BlobKey for a Google Storage File.
    createUploadUrl(String successPath)
    Deprecated.
    Create an absolute URL that can be used by a user to asynchronously upload a large blob.
    createUploadUrl(String successPath, UploadOptions uploadOptions)
    Deprecated.
    Create an absolute URL that can be used by a user to asynchronously upload a large blob.
    void
    delete(BlobKey... blobKeys)
    Deprecated.
    Permanently deletes the specified blobs.
    byte[]
    fetchData(BlobKey blobKey, long startIndex, long endIndex)
    Deprecated.
    Get fragment from specified blob.
    getBlobInfos(jakarta.servlet.http.HttpServletRequest request)
    Deprecated.
    Returns the BlobInfo for any files that were uploaded, keyed by the upload form "name" field.
    @Nullable ByteRange
    getByteRange(jakarta.servlet.http.HttpServletRequest request)
    Deprecated.
    Get byte range from the request.
    getFileInfos(jakarta.servlet.http.HttpServletRequest request)
    Deprecated.
    Returns the FileInfo for any files that were uploaded, keyed by the upload form "name" field.
    getUploadedBlobs(jakarta.servlet.http.HttpServletRequest request)
    getUploads(jakarta.servlet.http.HttpServletRequest request)
    Deprecated.
    Returns the BlobKey for any files that were uploaded, keyed by the upload form "name" field.
    void
    serve(BlobKey blobKey, @Nullable ByteRange byteRange, jakarta.servlet.http.HttpServletResponse response)
    Deprecated.
    Arrange for the specified blob to be served as the response content for the current request.
    void
    serve(BlobKey blobKey, jakarta.servlet.http.HttpServletResponse response)
    Deprecated.
    Arrange for the specified blob to be served as the response content for the current request.
    void
    serve(BlobKey blobKey, String rangeHeader, jakarta.servlet.http.HttpServletResponse response)
    Deprecated.
    Arrange for the specified blob to be served as the response content for the current request.
  • Field Details

  • Method Details

    • createUploadUrl

      String createUploadUrl(String successPath)
      Deprecated.
      Create an absolute URL that can be used by a user to asynchronously upload a large blob. Upon completion of the upload, a callback is made to the specified URL.
      Parameters:
      successPath - A relative URL which will be invoked after the user successfully uploads a blob. Must start with a "/", and must be URL-encoded.
    • createUploadUrl

      String createUploadUrl(String successPath, UploadOptions uploadOptions)
      Deprecated.
      Create an absolute URL that can be used by a user to asynchronously upload a large blob. Upon completion of the upload, a callback is made to the specified URL.
      Parameters:
      successPath - A relative URL which will be invoked after the user successfully uploads a blob. Must start with a "/".
      uploadOptions - Specific options applicable only for this upload URL.
    • serve

      void serve(BlobKey blobKey, jakarta.servlet.http.HttpServletResponse response) throws IOException
      Deprecated.
      Arrange for the specified blob to be served as the response content for the current request. response should be uncommitted before invoking this method, and should be assumed to be committed after invoking it. Any content written before calling this method will be ignored. You may, however, append custom headers before or after calling this method.

      Range header will be automatically translated from the Content-Range header in the response.

      Parameters:
      blobKey - Blob-key to serve in response.
      response - HTTP response object.
      Throws:
      IOException - If an I/O error occurred.
      IllegalStateException - If response was already committed.
    • serve

      void serve(BlobKey blobKey, @Nullable ByteRange byteRange, jakarta.servlet.http.HttpServletResponse response) throws IOException
      Deprecated.
      Arrange for the specified blob to be served as the response content for the current request. response should be uncommitted before invoking this method, and should be assumed to be committed after invoking it. Any content written before calling this method will be ignored. You may, however, append custom headers before or after calling this method.

      This method will set the App Engine blob range header to serve a byte range of that blob.

      Parameters:
      blobKey - Blob-key to serve in response.
      byteRange - Byte range to serve in response.
      response - HTTP response object.
      Throws:
      IOException - If an I/O error occurred.
      IllegalStateException - If response was already committed.
    • serve

      void serve(BlobKey blobKey, String rangeHeader, jakarta.servlet.http.HttpServletResponse response) throws IOException
      Deprecated.
      Arrange for the specified blob to be served as the response content for the current request. response should be uncommitted before invoking this method, and should be assumed to be committed after invoking it. Any content written before calling this method will be ignored. You may, however, append custom headers before or after calling this method.

      This method will set the App Engine blob range header to the content specified.

      Parameters:
      blobKey - Blob-key to serve in response.
      rangeHeader - Content for range header to serve.
      response - HTTP response object.
      Throws:
      IOException - If an I/O error occurred.
      IllegalStateException - If response was already committed.
    • getByteRange

      @Nullable ByteRange getByteRange(jakarta.servlet.http.HttpServletRequest request)
      Deprecated.
      Get byte range from the request.
      Parameters:
      request - HTTP request object.
      Returns:
      Byte range as parsed from the HTTP range header. null if there is no header.
    • delete

      void delete(BlobKey... blobKeys)
      Deprecated.
      Permanently deletes the specified blobs. Deleting unknown blobs is a no-op.
    • getUploadedBlobs

      @Deprecated Map<String,BlobKey> getUploadedBlobs(jakarta.servlet.http.HttpServletRequest request)
      Deprecated.
      Use getUploads(jakarta.servlet.http.HttpServletRequest) instead. Note that getUploadedBlobs does not handle cases where blobs have been uploaded using the multiple="true" attribute of the file input form element.
      Returns the BlobKey for any files that were uploaded, keyed by the upload form "name" field.

      This method should only be called from within a request served by the destination of a createUploadUrl call.

      Throws:
      IllegalStateException - If not called from a blob upload callback request.
    • getUploads

      Map<String,List<BlobKey>> getUploads(jakarta.servlet.http.HttpServletRequest request)
      Deprecated.
      Returns the BlobKey for any files that were uploaded, keyed by the upload form "name" field. This method should only be called from within a request served by the destination of a createUploadUrl(java.lang.String) call.
      Throws:
      IllegalStateException - If not called from a blob upload callback request.
      See Also:
    • getBlobInfos

      Map<String,List<BlobInfo>> getBlobInfos(jakarta.servlet.http.HttpServletRequest request)
      Deprecated.
      Returns the BlobInfo for any files that were uploaded, keyed by the upload form "name" field. This method should only be called from within a request served by the destination of a createUploadUrl(java.lang.String) call.
      Throws:
      IllegalStateException - If not called from a blob upload callback request.
      Since:
      1.7.5
      See Also:
    • getFileInfos

      Map<String,List<FileInfo>> getFileInfos(jakarta.servlet.http.HttpServletRequest request)
      Deprecated.
      Returns the FileInfo for any files that were uploaded, keyed by the upload form "name" field. This method should only be called from within a request served by the destination of a createUploadUrl(java.lang.String) call. Prefer this method over getBlobInfos(jakarta.servlet.http.HttpServletRequest) or getUploads(jakarta.servlet.http.HttpServletRequest) if uploading files to Cloud Storage, as the FileInfo contains the name of the created filename in Cloud Storage.
      Throws:
      IllegalStateException - If not called from a blob upload callback request.
      Since:
      1.7.5
      See Also:
    • fetchData

      byte[] fetchData(BlobKey blobKey, long startIndex, long endIndex)
      Deprecated.
      Get fragment from specified blob.
      Parameters:
      blobKey - Blob-key from which to fetch data.
      startIndex - Start index of data to fetch.
      endIndex - End index (inclusive) of data to fetch.
    • createGsBlobKey

      BlobKey createGsBlobKey(String filename)
      Deprecated.
      Create a BlobKey for a Google Storage File.

      The existence of the file represented by filename is not checked, hence a BlobKey can be created for a file that does not currently exist.

      You can safely persist the BlobKey generated by this function.

      The created BlobKey can then be used as a parameter in API methods that can support objects in Google Storage, for example serve(com.google.appengine.api.blobstore.BlobKey,jakarta.servlet.http.HttpServletResponse).

      Parameters:
      filename - The Google Storage filename. The filename must be in the format "/gs/bucket_name/object_name".
      Throws:
      IllegalArgumentException - If the filename does not have the prefix "/gs/".