Has user disable gzip (e.g., for benchmarking) in HttpServletRequest - Java File Path IO

Java examples for File Path IO:GZIP

Description

Has user disable gzip (e.g., for benchmarking) in HttpServletRequest

Demo Code


import java.io.IOException;
import java.io.PrintWriter;
import java.util.zip.GZIPOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class Main{
    /** Has user disable gzip (e.g., for benchmarking)? */
    public static boolean isGzipDisabled(HttpServletRequest request) {

        String flag = request.getParameter("disabledGzip");
        return ((flag != null) && (!flag.equalsIgnoreCase("false")));

    }//  w  w w .  j  a v a2 s  .c  o  m
}

Related Tutorials