Package overit.geocallapp.utilities.rs
Class WebResourceHelper
java.lang.Object
overit.geocallapp.utilities.rs.WebResourceHelper
Helper class for managing web resource operations including upload and download URL generation.
Maintains a singleton pattern per company package to ensure proper resource isolation and management.
Maintains a singleton pattern per company package to ensure proper resource isolation and management.
- Since:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intGets the default duration for download operations.getDownloadUrl(WebResource webResource) Generates a direct download URL for the specified web resource using current identity context.getDownloadUrl(WebResource webResource, HttpServletRequest httpServletRequest) Generates a direct download URL for the specified web resource using HTTP request context.protected intGets the default duration for upload operations.getUploadUrl(WebResource webResource) Generates a direct upload URL for the specified web resource using current identity context.getUploadUrl(WebResource webResource, HttpServletRequest httpServletRequest) Generates a direct upload URL for the specified web resource using HTTP request context.static WebResourceHelperGets the helper instance for the current company package.protected overit.geocall.servlet.WebResourceUrlgetWebResourceUrl(WebResource webResource, HttpServletRequest httpServletRequest, int duration) Creates aWebResourceUrlwith the specified parameters and browser policy.
-
Constructor Details
-
WebResourceHelper
public WebResourceHelper()
-
-
Method Details
-
getWebResourceHelper
Gets the helper instance for the current company package.- Returns:
- the
WebResourceHelperinstance for the current company
-
getWebResourceUrl
protected overit.geocall.servlet.WebResourceUrl getWebResourceUrl(WebResource webResource, HttpServletRequest httpServletRequest, int duration) Creates aWebResourceUrlwith the specified parameters and browser policy. Handles reference creation from either HTTP request or current identity.- Parameters:
webResource- theWebResourceto create URL forhttpServletRequest- theHttpServletRequestfor reference creation, or null to use current identityduration- the duration in milliseconds for the URL validity- Returns:
- a configured
WebResourceUrlinstance
-
getUploadDuration
protected int getUploadDuration()Gets the default duration for upload operations.- Returns:
- the upload duration in milliseconds
-
getUploadUrl
Generates a direct upload URL for the specified web resource using HTTP request context.- Parameters:
webResource- theWebResourceto generate upload URL forhttpServletRequest- theHttpServletRequestproviding request context- Returns:
- the direct upload URL string
-
getUploadUrl
Generates a direct upload URL for the specified web resource using current identity context.- Parameters:
webResource- theWebResourceto generate upload URL for- Returns:
- the direct upload URL string
-
getDownloadDuration
protected int getDownloadDuration()Gets the default duration for download operations.- Returns:
- the download duration in milliseconds
-
getDownloadUrl
Generates a direct download URL for the specified web resource using HTTP request context.- Parameters:
webResource- theWebResourceto generate download URL forhttpServletRequest- theHttpServletRequestproviding request context- Returns:
- the direct download URL string
-
getDownloadUrl
Generates a direct download URL for the specified web resource using current identity context.- Parameters:
webResource- theWebResourceto generate download URL for- Returns:
- the direct download URL string
-