Class WebResourceHelper

java.lang.Object
overit.geocallapp.utilities.rs.WebResourceHelper

public class WebResourceHelper extends Object
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.
Since:
1.0
  • Constructor Details

    • WebResourceHelper

      public WebResourceHelper()
  • Method Details

    • getWebResourceHelper

      public static WebResourceHelper getWebResourceHelper()
      Gets the helper instance for the current company package.
      Returns:
      the WebResourceHelper instance for the current company
    • getWebResourceUrl

      protected overit.geocall.servlet.WebResourceUrl getWebResourceUrl(WebResource webResource, HttpServletRequest httpServletRequest, int duration)
      Creates a WebResourceUrl with the specified parameters and browser policy. Handles reference creation from either HTTP request or current identity.
      Parameters:
      webResource - the WebResource to create URL for
      httpServletRequest - the HttpServletRequest for reference creation, or null to use current identity
      duration - the duration in milliseconds for the URL validity
      Returns:
      a configured WebResourceUrl instance
    • getUploadDuration

      protected int getUploadDuration()
      Gets the default duration for upload operations.
      Returns:
      the upload duration in milliseconds
    • getUploadUrl

      public String getUploadUrl(WebResource webResource, HttpServletRequest httpServletRequest)
      Generates a direct upload URL for the specified web resource using HTTP request context.
      Parameters:
      webResource - the WebResource to generate upload URL for
      httpServletRequest - the HttpServletRequest providing request context
      Returns:
      the direct upload URL string
    • getUploadUrl

      public String getUploadUrl(WebResource webResource)
      Generates a direct upload URL for the specified web resource using current identity context.
      Parameters:
      webResource - the WebResource to 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

      public String getDownloadUrl(WebResource webResource, HttpServletRequest httpServletRequest)
      Generates a direct download URL for the specified web resource using HTTP request context.
      Parameters:
      webResource - the WebResource to generate download URL for
      httpServletRequest - the HttpServletRequest providing request context
      Returns:
      the direct download URL string
    • getDownloadUrl

      public String getDownloadUrl(WebResource webResource)
      Generates a direct download URL for the specified web resource using current identity context.
      Parameters:
      webResource - the WebResource to generate download URL for
      Returns:
      the direct download URL string