com.liferay.portal.kernel.servlet
Class ServletResponseUtil

java.lang.Object
  extended by com.liferay.portal.kernel.servlet.ServletResponseUtil

public class ServletResponseUtil
extends java.lang.Object

Author:
Brian Wing Shun Chan, Shuyang Zhou

Constructor Summary
ServletResponseUtil()
           
 
Method Summary
protected static void copyRange(java.io.InputStream inputStream, java.io.OutputStream outputStream, long start, long length)
           
static java.util.List<Range> getRanges(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, long length)
           
protected static boolean isClientAbortException(java.io.IOException ioe)
           
static void sendFile(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String fileName, byte[] bytes)
           
static void sendFile(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String fileName, byte[] bytes, java.lang.String contentType)
           
static void sendFile(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String fileName, java.io.InputStream is)
           
static void sendFile(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String fileName, java.io.InputStream is, long contentLength, java.lang.String contentType)
           
static void sendFile(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String fileName, java.io.InputStream is, java.lang.String contentType)
           
static void sendFile(javax.servlet.http.HttpServletResponse response, java.lang.String fileName, byte[] bytes)
          Deprecated.  
static void sendFile(javax.servlet.http.HttpServletResponse response, java.lang.String fileName, byte[] bytes, java.lang.String contentType)
          Deprecated.  
static void sendFile(javax.servlet.http.HttpServletResponse response, java.lang.String fileName, java.io.InputStream is)
          Deprecated.  
static void sendFile(javax.servlet.http.HttpServletResponse response, java.lang.String fileName, java.io.InputStream is, int contentLength, java.lang.String contentType)
          Deprecated.  
static void sendFile(javax.servlet.http.HttpServletResponse response, java.lang.String fileName, java.io.InputStream is, java.lang.String contentType)
          Deprecated.  
protected static void setHeaders(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String fileName, java.lang.String contentType)
           
protected static void setHeaders(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String fileName, java.lang.String contentType, Range range)
           
static void write(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String fileName, java.util.List<Range> ranges, java.io.InputStream inputStream, long fullLength, java.lang.String contentType)
           
static void write(javax.servlet.http.HttpServletResponse response, byte[] bytes)
           
static void write(javax.servlet.http.HttpServletResponse response, byte[][] bytesArray)
           
static void write(javax.servlet.http.HttpServletResponse response, byte[] bytes, int offset, int contentLength)
           
static void write(javax.servlet.http.HttpServletResponse response, java.nio.ByteBuffer byteBuffer)
           
static void write(javax.servlet.http.HttpServletResponse response, java.io.File file)
           
static void write(javax.servlet.http.HttpServletResponse response, java.io.InputStream is)
           
static void write(javax.servlet.http.HttpServletResponse response, java.io.InputStream is, long contentLength)
           
static void write(javax.servlet.http.HttpServletResponse response, java.lang.String s)
           
static void write(javax.servlet.http.HttpServletResponse response, StringServletResponse stringResponse)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletResponseUtil

public ServletResponseUtil()
Method Detail

getRanges

public static java.util.List<Range> getRanges(javax.servlet.http.HttpServletRequest request,
                                              javax.servlet.http.HttpServletResponse response,
                                              long length)
                                       throws java.io.IOException
Throws:
java.io.IOException

sendFile

public static void sendFile(javax.servlet.http.HttpServletRequest request,
                            javax.servlet.http.HttpServletResponse response,
                            java.lang.String fileName,
                            byte[] bytes)
                     throws java.io.IOException
Throws:
java.io.IOException

sendFile

public static void sendFile(javax.servlet.http.HttpServletRequest request,
                            javax.servlet.http.HttpServletResponse response,
                            java.lang.String fileName,
                            byte[] bytes,
                            java.lang.String contentType)
                     throws java.io.IOException
Throws:
java.io.IOException

sendFile

public static void sendFile(javax.servlet.http.HttpServletRequest request,
                            javax.servlet.http.HttpServletResponse response,
                            java.lang.String fileName,
                            java.io.InputStream is)
                     throws java.io.IOException
Throws:
java.io.IOException

sendFile

public static void sendFile(javax.servlet.http.HttpServletRequest request,
                            javax.servlet.http.HttpServletResponse response,
                            java.lang.String fileName,
                            java.io.InputStream is,
                            long contentLength,
                            java.lang.String contentType)
                     throws java.io.IOException
Throws:
java.io.IOException

sendFile

public static void sendFile(javax.servlet.http.HttpServletRequest request,
                            javax.servlet.http.HttpServletResponse response,
                            java.lang.String fileName,
                            java.io.InputStream is,
                            java.lang.String contentType)
                     throws java.io.IOException
Throws:
java.io.IOException

sendFile

public static void sendFile(javax.servlet.http.HttpServletResponse response,
                            java.lang.String fileName,
                            byte[] bytes)
                     throws java.io.IOException
Deprecated. 

Throws:
java.io.IOException

sendFile

public static void sendFile(javax.servlet.http.HttpServletResponse response,
                            java.lang.String fileName,
                            byte[] bytes,
                            java.lang.String contentType)
                     throws java.io.IOException
Deprecated. 

Throws:
java.io.IOException

sendFile

public static void sendFile(javax.servlet.http.HttpServletResponse response,
                            java.lang.String fileName,
                            java.io.InputStream is)
                     throws java.io.IOException
Deprecated. 

Throws:
java.io.IOException

sendFile

public static void sendFile(javax.servlet.http.HttpServletResponse response,
                            java.lang.String fileName,
                            java.io.InputStream is,
                            int contentLength,
                            java.lang.String contentType)
                     throws java.io.IOException
Deprecated. 

Throws:
java.io.IOException

sendFile

public static void sendFile(javax.servlet.http.HttpServletResponse response,
                            java.lang.String fileName,
                            java.io.InputStream is,
                            java.lang.String contentType)
                     throws java.io.IOException
Deprecated. 

Throws:
java.io.IOException

write

public static void write(javax.servlet.http.HttpServletRequest request,
                         javax.servlet.http.HttpServletResponse response,
                         java.lang.String fileName,
                         java.util.List<Range> ranges,
                         java.io.InputStream inputStream,
                         long fullLength,
                         java.lang.String contentType)
                  throws java.io.IOException
Throws:
java.io.IOException

write

public static void write(javax.servlet.http.HttpServletResponse response,
                         byte[] bytes)
                  throws java.io.IOException
Throws:
java.io.IOException

write

public static void write(javax.servlet.http.HttpServletResponse response,
                         byte[] bytes,
                         int offset,
                         int contentLength)
                  throws java.io.IOException
Throws:
java.io.IOException

write

public static void write(javax.servlet.http.HttpServletResponse response,
                         byte[][] bytesArray)
                  throws java.io.IOException
Throws:
java.io.IOException

write

public static void write(javax.servlet.http.HttpServletResponse response,
                         java.nio.ByteBuffer byteBuffer)
                  throws java.io.IOException
Throws:
java.io.IOException

write

public static void write(javax.servlet.http.HttpServletResponse response,
                         java.io.File file)
                  throws java.io.IOException
Throws:
java.io.IOException

write

public static void write(javax.servlet.http.HttpServletResponse response,
                         java.io.InputStream is)
                  throws java.io.IOException
Throws:
java.io.IOException

write

public static void write(javax.servlet.http.HttpServletResponse response,
                         java.io.InputStream is,
                         long contentLength)
                  throws java.io.IOException
Throws:
java.io.IOException

write

public static void write(javax.servlet.http.HttpServletResponse response,
                         java.lang.String s)
                  throws java.io.IOException
Throws:
java.io.IOException

write

public static void write(javax.servlet.http.HttpServletResponse response,
                         StringServletResponse stringResponse)
                  throws java.io.IOException
Throws:
java.io.IOException

copyRange

protected static void copyRange(java.io.InputStream inputStream,
                                java.io.OutputStream outputStream,
                                long start,
                                long length)
                         throws java.io.IOException
Throws:
java.io.IOException

isClientAbortException

protected static boolean isClientAbortException(java.io.IOException ioe)

setHeaders

protected static void setHeaders(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response,
                                 java.lang.String fileName,
                                 java.lang.String contentType)

setHeaders

protected static void setHeaders(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response,
                                 java.lang.String fileName,
                                 java.lang.String contentType,
                                 Range range)