Announcement Announcement Module
No announcement yet.
Creating a custom for HTTPClient Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Creating a custom for HTTPClient

    I have written a Resource implementation that uses Apache HTTPClient instead of (as used by UrlResource).

    Because DefaultResourceLoader explicitly constructs a UrlResource, I wrote an extension of ClassPathXMLApplicationContext overriding getResource as appropriate. This seems clumsy as there are many ways to get a Context and I cannot be sure to have intercepted all ways we may choose to define our application (see (c) below).

    a) Is there a better way to achieve this goal? My worst-case scenario is to patch DefaultResourceLoader itself.
    b) If I wanted to register a new uri type (e.g. "scp://") would I be looking to do the same thing?
    c) How do I integrate the solution with Spring Testframework @ContextConfiguration as I am not directly in control of the class-to-construct in this circumstance.

    I hope to be told of some kind of PluggableResourceLoader that would answer all three of these.

    Thanks all.