serve

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:

java.io.IOException - If an I/O error occurred.

java.lang.IllegalStateException - If response was already committed.

serve

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:

java.io.IOException - If an I/O error occurred.

java.lang.IllegalStateException - If response was already committed.

serve

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.

getUploadedBlobs

Deprecated.Use getUploads(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:

java.lang.IllegalStateException - If not called from a blob upload
callback request.

getUploads

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:

java.lang.IllegalStateException - If not called from a blob upload
callback request.

See Also:

getBlobInfos, getFileInfos

getBlobInfos

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 call.

Throws:

java.lang.IllegalStateException - If not called from a blob upload
callback request.

See Also:

getFileInfos, getUploads

getFileInfos

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 call.
Prefer this method over getBlobInfos or getUploads if
uploading files to Cloud Storage, as the FileInfo contains the name of the
created filename in Cloud Storage.

Throws:

java.lang.IllegalStateException - If not called from a blob upload
callback request.

createGsBlobKey

Create a BlobKey for a Google Storage File.
The existance 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.

Parameters:

filename - The Google Storage filename. The filename must be in the
format "/gs/bucket_name/object_name".

Throws:

java.lang.IllegalArgumentException - If the filename does not have the prefix
"/gs/".