public class CloudStorageHelper2
extends java.lang.Object
Constructor and Description |
---|
CloudStorageHelper2() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getImageUrl(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp,
java.lang.String bucket)
Extracts the file payload from an HttpServletRequest, checks that the file extension
is supported and uploads the file to Google Cloud Storage.
|
java.lang.String |
uploadFile(javax.servlet.http.Part filePart,
java.lang.String bucketName)
Uploads a file to Google Cloud Storage to the bucket specified in the BUCKET_NAME
environment variable, appending a timestamp to end of the uploaded filename.
|
public java.lang.String uploadFile(javax.servlet.http.Part filePart, java.lang.String bucketName) throws java.io.IOException
java.io.IOException
public java.lang.String getImageUrl(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, java.lang.String bucket) throws java.io.IOException, javax.servlet.ServletException
java.io.IOException
javax.servlet.ServletException