Class RequestUtils


  • public class RequestUtils
    extends Object
    Utility class performing operations related to http requests.
    Author:
    Justin Deoliveira, The Open Planning Project, jdeolive@openplans.org

    TODO: this class needs to be merged with org.vfny.geoserver.Requests.

    • Constructor Detail

      • RequestUtils

        public RequestUtils()
    • Method Detail

      • getBufferedXMLReader

        public static BufferedReader getBufferedXMLReader​(InputStream stream,
                                                          int xmlLookahead)
                                                   throws IOException
        Wraps an xml input xstream in a buffered reader specifying a lookahead that can be used to preparse some of the xml document, resetting it back to its original state for actual parsing.
        Parameters:
        stream - The original xml stream.
        xmlLookahead - The number of bytes to support for parse. If more than this number of bytes are preparsed the stream can not be properly reset.
        Returns:
        The buffered reader.
        Throws:
        IOException
      • getBufferedXMLReader

        public static BufferedReader getBufferedXMLReader​(Reader reader,
                                                          int xmlLookahead)
                                                   throws IOException
        Wraps an xml reader in a buffered reader specifying a lookahead that can be used to preparse some of the xml document, resetting it back to its original state for actual parsing.
        Parameters:
        reader - The original xml reader.
        xmlLookahead - The number of bytes to support for parse. If more than this number of bytes are preparsed the stream can not be properly reset.
        Returns:
        The buffered reader.
        Throws:
        IOException