public class Download extends HttpServlet
For more information on servlets, see http://java.sun.com/products/java-server/servlets/index.html
Modifier and Type | Field and Description |
---|---|
(package private) String |
bodyContent_
Body Content.
|
private static String |
BUILD_TAG
Build String.
|
private static Calendar |
calendar_
Description of the Field
|
private static String |
DEFAULT_DOWNLOAD_LOG_FILE
Download Log File Name.
|
private static String |
DEFAULT_LOG_FILE
Log File Name.
|
(package private) File |
downloadLogFile_
Description of the Field
|
(package private) String |
downloadUrl_
The url to the resource to download.
|
(package private) String |
initDownloadLogFilename_
The default download log filename
|
private static Log |
log
The debug logger.
|
(package private) String |
scriptHead_
The html header string (<head>) that is included on all folder view
pages.
|
private static String |
SERVLET_VERSION
Version String.
|
(package private) String |
svnDir_
This gets assigned if a Subversion repository based file is requested:
it will hold the sub dir to visit to retrieve the file.
|
(package private) String |
svnFile_
This gets assigned if a Subversion repository based file is requested:
it will hold the file to retrieve.
|
(package private) boolean |
svnFileGzip_
This gets assigned if a Subversion repository based file is requested:
to be gzipped.
|
(package private) String |
svnFileRev_
This gets assigned if a Subversion repository based file is requested:
it will hold the revision number for the file to retrieve.
|
(package private) String |
svnRepoURL_
This gets assigned if a Subversion repository based file is requested:
it will hold the URL for the repo.
|
private static String |
SYSTEM_FILE_SEPERATOR
Description of the Field
|
(package private) String |
title_
Description of the Field
|
private static String |
webServerHostName_
This servers name.
|
Constructor and Description |
---|
Download() |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Override to close the Log *
|
private void |
doDownload(HttpServletRequest req,
HttpServletResponse res)
This method goes and performs the actual download of a resource file.
|
void |
doGet(HttpServletRequest req,
HttpServletResponse res)
This method handles the "GET" submission and goes and gets the
download file.
|
void |
doPost(HttpServletRequest req,
HttpServletResponse res)
This method handles the "POST" submission.
|
private String |
getDownloadBody()
Gets the body attribute of the Download object
|
private String |
getHead()
Gets the head attribute of the Download object
|
String |
getServletInfo()
Gets the ServletInfo attribute of the JavaMailServlet object
|
void |
init()
The one time servlet init stuff goes here.
|
private void |
logTheDownload(HttpServletRequest req,
String downloadUrl)
Writes the log info to the file
|
private void |
streamSVNBytes(HttpServletRequest req,
HttpServletResponse res,
boolean compressGzip)
This method goes and performs the download/streaming of the svn file.
|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log
private static final String SYSTEM_FILE_SEPERATOR
private static final String SERVLET_VERSION
private static final String BUILD_TAG
private static String webServerHostName_
private static final String DEFAULT_LOG_FILE
private static final String DEFAULT_DOWNLOAD_LOG_FILE
String downloadUrl_
String svnRepoURL_
String svnDir_
String svnFile_
String svnFileRev_
boolean svnFileGzip_
String scriptHead_
String bodyContent_
String initDownloadLogFilename_
File downloadLogFile_
public Download()
public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
doGet
in class HttpServlet
req
- Description of the Parameterres
- Description of the ParameterServletException
- Description of the ExceptionIOException
- Description of the Exceptionpublic String getServletInfo()
getServletInfo
in interface Servlet
getServletInfo
in class GenericServlet
public void init()
init
in class GenericServlet
public void destroy()
destroy
in interface Servlet
destroy
in class GenericServlet
public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
doPost
in class HttpServlet
req
- Description of Parameterres
- Description of ParameterServletException
- Description of ExceptionIOException
- Description of Exceptionprivate void doDownload(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
req
- Description of Parameterres
- Description of ParameterServletException
- Description of ExceptionIOException
- Description of Exceptionprivate void streamSVNBytes(HttpServletRequest req, HttpServletResponse res, boolean compressGzip) throws ServletException, IOException
req
- Description of Parameterres
- Description of ParameterServletException
- Description of ExceptionIOException
- Description of Exceptionprivate void logTheDownload(HttpServletRequest req, String downloadUrl)
req
- Description of the ParameterdownloadUrl
- Description of the Parameterprivate String getHead()
private String getDownloadBody()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses