public class GetServiceFileServlet
extends javax.servlet.http.HttpServlet
| Constructor and Description |
|---|
GetServiceFileServlet() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
createFileUrl(javax.servlet.http.HttpServletRequest request,
File f)
Create the url to the file
|
protected void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles the HTTP
GET method. |
protected void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles the HTTP
POST method. |
protected File |
getCorrectedFile(String fileString)
Get the corrected File (relative to jvm or absolute)
|
String |
getServletInfo()
Returns a short description of the servlet.
|
void |
init(javax.servlet.ServletConfig config) |
protected void |
processRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Processes requests for both HTTP
GET and POST methods. |
protected void |
writeErrorMessage(javax.servlet.http.HttpServletResponse response,
String message)
Write a html page as error
|
protected void |
writeFile(javax.servlet.http.HttpServletResponse response,
File file)
write a file to the output
|
protected void |
writeFileNotFoundMessage(javax.servlet.http.HttpServletResponse response,
String fileString)
Write a file not found error message
|
protected void |
writeFileToHtml(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
File file)
Write a link to the file in html
|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, servicepublic static final String FILE
public void init(javax.servlet.ServletConfig config)
throws javax.servlet.ServletException
init in interface javax.servlet.Servletinit in class javax.servlet.GenericServletjavax.servlet.ServletExceptionprotected void processRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
IOException
GET and POST methods.request - servlet requestresponse - servlet responsejavax.servlet.ServletException - if a servlet-specific error occursIOException - if an I/O error occursprotected void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
IOException
GET method.doGet in class javax.servlet.http.HttpServletrequest - servlet requestresponse - servlet responsejavax.servlet.ServletException - if a servlet-specific error occursIOException - if an I/O error occursprotected void doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
IOException
POST method.doPost in class javax.servlet.http.HttpServletrequest - servlet requestresponse - servlet responsejavax.servlet.ServletException - if a servlet-specific error occursIOException - if an I/O error occurspublic String getServletInfo()
getServletInfo in interface javax.servlet.ServletgetServletInfo in class javax.servlet.GenericServletprotected void writeFile(javax.servlet.http.HttpServletResponse response,
File file)
throws IOException
IOExceptionprotected void writeErrorMessage(javax.servlet.http.HttpServletResponse response,
String message)
throws IOException
IOExceptionprotected String createFileUrl(javax.servlet.http.HttpServletRequest request, File f)
protected void writeFileToHtml(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
File file)
throws IOException
IOExceptionprotected File getCorrectedFile(String fileString)
protected void writeFileNotFoundMessage(javax.servlet.http.HttpServletResponse response,
String fileString)
throws IOException
IOExceptionCopyright © 2015. All rights reserved.