com.xmlserv.util
Class FileUpload

java.lang.Object
  |
  +--com.xmlserv.util.FileUpload

public class FileUpload
extends java.lang.Object

A class to implement HTTP uploads via multipart encoded requests. This code was adapted from work done by Sten Hjelmqvist,sten@stockholm.bonet.se. The adaptions include the port to apache regexp.

Version:
$Id: FileUpload.java,v 1.7 2002/04/16 12:33:05 muecke Exp $
Author:
Wolfram Saringer, Sten Hjelmqvist

Constructor Summary
FileUpload()
           
 
Method Summary
 java.lang.String getFileName()
          Get the name of the uploaded file.
 java.io.InputStream getStream()
          Get the InputStream holding the content of the uploaded file.
 void process(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest req)
          Process the upload request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUpload

public FileUpload()
Method Detail

process

public void process(javax.servlet.ServletContext context,
                    javax.servlet.http.HttpServletRequest req)
             throws XMLServException,
                    javax.servlet.ServletException,
                    java.io.IOException
Process the upload request. Currently only one file per upload is supported.
Parameters:
context - The servlet context.
req - The HTTP request.
Throws:
XMLServException - A Processing error occurred.
javax.servlet.ServletException - Indicating a problem with the request.
java.io.IOException - A problem reading the uploaded files.

getFileName

public java.lang.String getFileName()
Get the name of the uploaded file.
Returns:
The filename.

getStream

public java.io.InputStream getStream()
Get the InputStream holding the content of the uploaded file.
Returns:
The InputStream.