Package org.geoserver.ows.util

Examples of org.geoserver.ows.util.EncodingInfo


        //create a buffer so we can reset the input stream
        BufferedInputStream input = new BufferedInputStream(httpRequest.getInputStream());
        input.mark(XML_LOOKAHEAD);

        //create object to hold encoding info
        EncodingInfo encoding = new EncodingInfo();

        //call this method to set the encoding info
        XmlCharsetDetector.getCharsetAwareReader(input, encoding);

        //call this method to create the reader
View Full Code Here


            String formatted = format.format(new Date(lastModified)) + " GMT";
            response.setHeader("Last-Modified", formatted);
        }

        // Guessing the charset (and closing the stream)
        EncodingInfo encInfo = null;
        FileInputStream input = null;
        OutputStream output = null;
        final byte[] b4 = new byte[4];
        int count = 0;
        try {
            // open the output
            input = new FileInputStream(file);
          
            // Read the first four bytes, and determine charset encoding
            count = input.read(b4);
            encInfo = XmlCharsetDetector.getEncodingName(b4, count);
            response.setCharacterEncoding(encInfo.getEncoding() != null ? encInfo.getEncoding() : "UTF-8");
           
            // send out the first four bytes read
            output = response.getOutputStream();
            output.write(b4, 0, count);
       
View Full Code Here

            if (lastModified > 0) {
                response.setHeader("Last-Modified", lastModified(lastModified));
            }

            // Guessing the charset (and closing the stream)
            EncodingInfo encInfo = null;
            OutputStream output = null;
            final byte[] b4 = new byte[4];
            int count = 0;
            // open the output
            input = connection.getInputStream();

            // Read the first four bytes, and determine charset encoding
            count = input.read(b4);
            encInfo = XmlCharsetDetector.getEncodingName(b4, count);
            response.setCharacterEncoding(encInfo.getEncoding() != null ? encInfo.getEncoding()
                    : "UTF-8");

            //count < 1 -> empty file
            if (count > 0) {
                // send out the first four bytes read
View Full Code Here

            String formatted = format.format(new Date(lastModified)) + " GMT";
            response.setHeader("Last-Modified", formatted);
        }

        // Guessing the charset (and closing the stream)
        EncodingInfo encInfo = null;
        FileInputStream input = null;
        OutputStream output = null;
        final byte[] b4 = new byte[4];
        int count = 0;
        try {
            // open the output
            input = new FileInputStream(file);
          
            // Read the first four bytes, and determine charset encoding
            count = input.read(b4);
            encInfo = XmlCharsetDetector.getEncodingName(b4, count);
            response.setCharacterEncoding(encInfo.getEncoding() != null ? encInfo.getEncoding() : "UTF-8");
           
            // send out the first four bytes read
            output = response.getOutputStream();
            output.write(b4, 0, count);
       
View Full Code Here

TOP

Related Classes of org.geoserver.ows.util.EncodingInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.