|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.autonomy.utilities.HTTPFileUpload
Class to process any form submitted from a HTML page using the:
<form enctype="multipart/form-data">
HTTPFileUpload upload = new HTTPFileUpload( request.getInputStream(), "c:\\temp", 4096, 1024 );
String sFileName = upload.getParamter( sUploadFileFormName );
String sTextAreaContents = upload.getParameter( "myTextArea" );
String sFileContentType = upload.getContentType( sFileName );
Field Summary | |
int |
m_nMaxLength
|
Constructor Summary | |
HTTPFileUpload(java.io.InputStream ISInput,
java.lang.String sInputTempDir,
int nInputMaxLength,
int nInputBufferSize)
Constructor - parses the given input stream |
Method Summary | |
static boolean |
byteArrayHasAtEnd(byte[] ba1,
byte[] ba2)
See if the end of byte array 1 is identical to byte array 2 |
static boolean |
byteArrayHasAtEnd(byte[] ba1,
byte[] ba2,
int nEnd)
See if the subset of byte array 1 that ends at point nEnd, is identical to byte array 2 |
java.lang.String |
getContentType(java.lang.String sFileName)
Gets content type for a given filename. |
java.util.Enumeration |
getFileNames()
Enumerates through the uploaded filenames |
java.lang.String |
getOriginalFilename(java.lang.String sFileName)
Gets the original filename on a client machine of a given filename. |
java.lang.String |
getParameter(java.lang.String sName)
Gets the first entry for a given name. |
java.util.Enumeration |
getParameterNames()
Enumerates through the parameter names |
java.util.Vector |
getParameterValues(java.lang.String sName)
Gets a parameter list |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public int m_nMaxLength
Constructor Detail |
public HTTPFileUpload(java.io.InputStream ISInput, java.lang.String sInputTempDir, int nInputMaxLength, int nInputBufferSize) throws java.lang.Exception
ISInput
- containing the datasInputTempDir
- Temporary directory to store filesnInputMaxLength
- Max length of upload in bytesnInputBufferSize
- buffer size for reading from input streamMethod Detail |
public static boolean byteArrayHasAtEnd(byte[] ba1, byte[] ba2)
public static boolean byteArrayHasAtEnd(byte[] ba1, byte[] ba2, int nEnd)
public java.lang.String getParameter(java.lang.String sName)
sName
- name of element
public java.util.Enumeration getParameterNames()
public java.util.Enumeration getFileNames()
public java.util.Vector getParameterValues(java.lang.String sName)
sName
- name of parameter to get
public java.lang.String getContentType(java.lang.String sFileName)
sFileName
- name of element. You can get this by doing getParameter(sName) where sName is the name of the HTML element associated with the file
public java.lang.String getOriginalFilename(java.lang.String sFileName)
sFileName
- name of element. You can get this by doing getParameter(sName) where sName is the name of the HTML element associated with the file
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |