public class CloudStorageHelper
extends java.lang.Object
Constructor and Description |
---|
CloudStorageHelper() |
Modifier and Type | Method and Description |
---|---|
com.google.cloud.storage.BlobInfo |
getImageUrl(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp,
java.lang.String bucket,
java.lang.String path)
Extracts the file payload from an HttpServletRequest, checks that the file extension
is supported and uploads the file to Google Cloud Storage.
|
com.google.cloud.storage.BlobInfo |
upload(javax.servlet.http.Part filePart,
java.lang.String bucketName,
java.lang.String path,
java.lang.String fileName) |
com.google.cloud.storage.BlobInfo |
uploadFile(javax.servlet.http.Part filePart,
java.lang.String bucketName,
java.lang.String path)
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 com.google.cloud.storage.BlobInfo uploadFile(javax.servlet.http.Part filePart, java.lang.String bucketName, java.lang.String path) throws java.io.IOException
java.io.IOException
public com.google.cloud.storage.BlobInfo getImageUrl(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, java.lang.String bucket, java.lang.String path) throws java.io.IOException, javax.servlet.ServletException
java.io.IOException
javax.servlet.ServletException
public com.google.cloud.storage.BlobInfo upload(javax.servlet.http.Part filePart, java.lang.String bucketName, java.lang.String path, java.lang.String fileName)