org.zkoss.zkmax.au.http
Class AuDownloader

java.lang.Object
  extended by org.zkoss.zkmax.au.http.AuDownloader
All Implemented Interfaces:
AuProcessor

public class AuDownloader
extends java.lang.Object
implements AuProcessor

The AU processor to handle the resumable download.

Since:
3.5.0
Author:
tomyeh
See Also:
Filedownload

Method Summary
static java.lang.String getDownloadURI(java.io.File file, java.lang.String contentType, java.lang.String data)
          Returns the download URI of the specified file.
static java.lang.String getDownloadURI(java.lang.String path, java.lang.String contentType, java.lang.String data)
          Returns the download URI of the specified file.
static java.lang.String getDownloadURI(java.net.URL url, java.lang.String contentType, java.lang.String data)
          Returns the download URI of the specified file.
static void init(WebApp wapp)
          Initializes the downloader.
 void process(Session sess, javax.servlet.ServletContext ctx, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String pi)
          Called to process the request if the session is available.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

init

public static void init(WebApp wapp)
Initializes the downloader.


getDownloadURI

public static java.lang.String getDownloadURI(java.io.File file,
                                              java.lang.String contentType,
                                              java.lang.String data)
Returns the download URI of the specified file.


getDownloadURI

public static java.lang.String getDownloadURI(java.net.URL url,
                                              java.lang.String contentType,
                                              java.lang.String data)
Returns the download URI of the specified file.


getDownloadURI

public static java.lang.String getDownloadURI(java.lang.String path,
                                              java.lang.String contentType,
                                              java.lang.String data)
Returns the download URI of the specified file.

Parameters:
path - the path to access the resource of the Web application. In other words, it is URI of ServletContext. Since 3.6.1: if the path is relative, Desktop.getCurrentDirectory() is assumed.

process

public void process(Session sess,
                    javax.servlet.ServletContext ctx,
                    javax.servlet.http.HttpServletRequest request,
                    javax.servlet.http.HttpServletResponse response,
                    java.lang.String pi)
             throws javax.servlet.ServletException,
                    java.io.IOException
Description copied from interface: AuProcessor
Called to process the request if the session is available.

Specified by:
process in interface AuProcessor
Parameters:
sess - the session, or null if the session is not available.
ctx - the servlet context (never null).
request - the request (never null).
response - the response (never null).
pi - the path info. It includes the prefix when the Au processor is associated (see DHtmlUpdateServlet.addAuProcessor(org.zkoss.zk.ui.WebApp, java.lang.String, org.zkoss.zk.au.http.AuProcessor). For example, if an AU processor is assoicated with "/upload", then pi must start with "/upload". Note: it might end with other string depending on the URI you generated to the client.
Throws:
javax.servlet.ServletException
java.io.IOException


Copyright © 2005-2009 Potix Corporation. All Rights Reserved. SourceForge.net Logo