is Gzip Supported HttpServletRequest - Java File Path IO

Java examples for File Path IO:GZIP

Description

is Gzip Supported HttpServletRequest

Demo Code


import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.zip.*;

public class Main{
    public static boolean isGzipSupported(HttpServletRequest request) {
        String encodings = request.getHeader("Accept-Encoding");
        return ((encodings != null) && (encodings.indexOf("gzip") != -1));
    }/*  w  w w. j a v a 2  s .  c o  m*/
}

Related Tutorials