Class LinkRewriter

  • All Implemented Interfaces:
    Closeable, Flushable, Appendable, AutoCloseable

    public class LinkRewriter
    extends PrintWriter
    This is a special PrintWriter that is capable of incrementally looking for strings of the form "[#name#]" and replace the module "name" with the URL where the named module is actually mounted. This allows modules to be agnostic to where their dependencies are mount, making it easier to reuse modules across different web applications. NOTE: great care has been taken in making sure that this writer is incremental, meaning that works by minimizing the amount of buffering that it needs to operate. This is because we don't want such rewriting to be an impact for the perceived performance of responses.