Class ResponseContentProcessor

java.lang.Object
com.xceptance.xlt.api.util.AbstractResponseProcessor
com.xceptance.xlt.api.util.ResponseContentProcessor
All Implemented Interfaces:
ResponseProcessor

public class ResponseContentProcessor extends AbstractResponseProcessor
A ResponseProcessor implementation, which modifies the body of a web response based on regular expressions.
  • Constructor Details

    • ResponseContentProcessor

      public ResponseContentProcessor(String contentPattern, String replacement)
      Creates a new ResponseContentProcessor object.
      Parameters:
      contentPattern - a regex specifying the piece of content to be replaced
      replacement - the replacement string
    • ResponseContentProcessor

      public ResponseContentProcessor(String contentPattern, String replacement, String urlPattern)
      Creates a new ResponseContentProcessor object.
      Parameters:
      contentPattern - a regex specifying the piece of content to be replaced
      replacement - the replacement string
      urlPattern - a regex specifying the URL(s) for which to apply the replacement
    • ResponseContentProcessor

      public ResponseContentProcessor(Pattern contentPattern, String replacement)
      Creates a new ResponseContentProcessor object.
      Parameters:
      contentPattern - a regex specifying the piece of content to be replaced
      replacement - the replacement string
    • ResponseContentProcessor

      public ResponseContentProcessor(Pattern contentPattern, String replacement, Pattern urlPattern)
      Creates a new ResponseContentProcessor object.
      Parameters:
      contentPattern - a regex specifying the piece of content to be replaced
      replacement - the replacement string
      urlPattern - a regex specifying the URL(s) for which to apply the replacement
  • Method Details

    • processResponse

      public WebResponse processResponse(WebResponse webResponse)
      Processes the content of a response.
      Parameters:
      webResponse - the web response to modify
      Returns:
      the (potentially) modified web response