home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-09-13 | 1.2 KB | 55 lines |
- package symantec.sourcebook.servlet;
- import java.io.*;
- import java.net.*;
- import javax.servlet.*;
- import javax.servlet.http.*;
-
- public class PHDownload extends PHOwner
- {
-
-
- Transaction t;
- String name;
- String orderId;
- String total;
- byte[] fileData;
-
- int pagenumber = ESDServlet.DOWNLOAD_PAGE_NUM;
-
- private final static String PAGENAME = PAGEBASE + "killerapp.class";
-
- public PHDownload()
- {
- }
-
- public String pageName()
- {
- return PAGENAME;
- }
-
-
- protected void read() throws IOException
- {
- FileInputStream in = new FileInputStream(pageName());
- fileData = new byte[in.available()];
- in.read(fileData);
- in.close();
- }
-
- protected void customize(Object pageDataObject) throws IOException
- {
- // do nothing
- }
-
- protected void write(HttpServletResponse response) throws IOException
- {
- response.setContentType("application/x-javaclass");
- response.setHeader("Content-Disposition","attachment; filename=killerapp.class;");
- response.setContentLength(fileData.length);
- ServletOutputStream out = response.getOutputStream();
- out.write(fileData);
- }
-
-
-
- }