String successPath = request.getParameter("successPath");
return (successPath != null) ? "/" + successPath : "/uploadHandler";
}
protected UploadOptions parseOptions(HttpServletRequest request) {
UploadOptions options = UploadOptions.Builder.withDefaults();
String maxPerBlob = request.getParameter("max_per_blob");
if (maxPerBlob != null) {
options.maxUploadSizeBytesPerBlob(Long.parseLong(maxPerBlob));
}
String maxAll = request.getParameter("max_all");
if (maxAll != null) {
options.maxUploadSizeBytes(Long.parseLong(maxAll));
}
String bucketName = request.getParameter("bucket_name");
if (bucketName != null) {
options.googleStorageBucketName(bucketName);
}
return options;
}