org.apache.turbine.util.upload
Class FileHandler

java.lang.Object
  |
  +--org.apache.turbine.util.upload.FileHandler

Deprecated. Use TurbineUploadService counterpart FileItem.

public class FileHandler
extends java.lang.Object

This class is used to upload files from a client to the server (any types and any number of fields is supported) and download files from the server to the client.

Author:
Oleg M. Podolsky, Neeme Praks

Field Summary
static java.lang.String PARAMETER_NAME_CONTENT_TYPE
          Deprecated.  
static java.lang.String PARAMETER_NAME_ENCODING
          Deprecated.  
static java.lang.String PARAMETER_NAME_FILENAME
          Deprecated.  
static java.lang.String PARAMETER_NAME_FILENAME_SAVED
          Deprecated.  
static java.lang.String PARAMETER_NAME_FILESIZE
          Deprecated.  
 
Constructor Summary
FileHandler(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, ParameterParser pp)
          Deprecated. Use TurbineUploadService counterpart FileItem.
FileHandler(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, ParameterParser pp, java.lang.String root)
          Deprecated. Use TurbineUploadService counterpart FileItem.
FileHandler(javax.servlet.http.HttpServletRequest req, ParameterParser pp, java.lang.String root)
          Deprecated. Use TurbineUploadService counterpart FileItem.
FileHandler(RunData data)
          Deprecated. Use TurbineUploadService counterpart FileItem.
FileHandler(RunData data, java.lang.String root)
          Deprecated. Use TurbineUploadService counterpart FileItem.
 
Method Summary
 boolean deleteFile(java.lang.String filename)
          Deprecated. Use TurbineUploadService counterpart FileItem.
 java.lang.String getFileRepository()
          Deprecated. Use TurbineUploadService counterpart FileItem.
static boolean isSimpleForm(javax.servlet.http.HttpServletRequest req)
          Deprecated. Use TurbineUploadService counterpart FileItem.
 void saveStream()
          Deprecated. Use TurbineUploadService counterpart FileItem.
 void setFileRepository(java.lang.String root)
          Deprecated. Use TurbineUploadService counterpart FileItem.
 void setMaxSize(long size)
          Deprecated. Use TurbineUploadService counterpart FileItem.
 void writeFileToResponse(java.lang.String savedname, java.lang.String filename, java.lang.String contenttype)
          Deprecated. Use TurbineUploadService counterpart FileItem.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAMETER_NAME_FILENAME

public static java.lang.String PARAMETER_NAME_FILENAME
Deprecated. 

PARAMETER_NAME_FILESIZE

public static java.lang.String PARAMETER_NAME_FILESIZE
Deprecated. 

PARAMETER_NAME_FILENAME_SAVED

public static java.lang.String PARAMETER_NAME_FILENAME_SAVED
Deprecated. 

PARAMETER_NAME_ENCODING

public static java.lang.String PARAMETER_NAME_ENCODING
Deprecated. 

PARAMETER_NAME_CONTENT_TYPE

public static java.lang.String PARAMETER_NAME_CONTENT_TYPE
Deprecated. 
Constructor Detail

FileHandler

public FileHandler(javax.servlet.http.HttpServletRequest req,
                   javax.servlet.http.HttpServletResponse res,
                   ParameterParser pp)
Deprecated. Use TurbineUploadService counterpart FileItem.

Performs initialization.
Parameters:
req - An HttpServletRequest.
res - An HttpServletResponse.
pp - A ParameterParser.

FileHandler

public FileHandler(javax.servlet.http.HttpServletRequest req,
                   javax.servlet.http.HttpServletResponse res,
                   ParameterParser pp,
                   java.lang.String root)
Deprecated. Use TurbineUploadService counterpart FileItem.

Performs initialization.
Parameters:
req - An HttpServletRequest.
res - An HttpServletResponse.
pp - A ParameterParser.
root - A String.

FileHandler

public FileHandler(javax.servlet.http.HttpServletRequest req,
                   ParameterParser pp,
                   java.lang.String root)
Deprecated. Use TurbineUploadService counterpart FileItem.

Performs initialization.
Parameters:
req - An HttpServletRequest.
res - An HttpServletResponse.
root - A String.

FileHandler

public FileHandler(RunData data,
                   java.lang.String root)
Deprecated. Use TurbineUploadService counterpart FileItem.

Performs initialization.
Parameters:
data - A Turbine RunData object.
root - A String.

FileHandler

public FileHandler(RunData data)
Deprecated. Use TurbineUploadService counterpart FileItem.

Performs initialization.
Parameters:
data - A Turbine RunData object.
Method Detail

isSimpleForm

public static boolean isSimpleForm(javax.servlet.http.HttpServletRequest req)
Deprecated. Use TurbineUploadService counterpart FileItem.

If the form data is non-multipart (simple), it returns true, otherwise returns false.
Parameters:
req - An HttpServletRequest.
Returns:
True if the form data is non-multipart (simple).

writeFileToResponse

public void writeFileToResponse(java.lang.String savedname,
                                java.lang.String filename,
                                java.lang.String contenttype)
                         throws java.lang.Exception
Deprecated. Use TurbineUploadService counterpart FileItem.

Writes HTTP headers and the file data to the response.
Parameters:
savedname - A String.
filename - A String.
contenttype - A String.
Throws:
Exception, - a generic exception.

saveStream

public void saveStream()
                throws javax.servlet.ServletException,
                       java.io.IOException
Deprecated. Use TurbineUploadService counterpart FileItem.

Stores all data.
Throws:
ServletException. -  
IOException. -  

setFileRepository

public void setFileRepository(java.lang.String root)
Deprecated. Use TurbineUploadService counterpart FileItem.

Sets the root file repository.
Parameters:
root - A String.

getFileRepository

public java.lang.String getFileRepository()
Deprecated. Use TurbineUploadService counterpart FileItem.

Gets the root file repository.
Returns:
A String.

setMaxSize

public void setMaxSize(long size)
Deprecated. Use TurbineUploadService counterpart FileItem.

Sets the maximum size.
Parameters:
size - A long.

deleteFile

public boolean deleteFile(java.lang.String filename)
Deprecated. Use TurbineUploadService counterpart FileItem.

Deletes the file.
Parameters:
filename - A String.
Returns:
True if file was deleted.


Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.