|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dbforms.util.FileHolder
public class FileHolder
A FileHolder
holds data saved from a
com.oreilly.servlet.multipart.FilePart either as byteArray [now] or as
reference to temp-file[future versions]
Constructor Summary | |
---|---|
FileHolder(String fileName,
org.apache.commons.fileupload.FileItem fileItem)
Constructor - takes descriptive data (fileName, contentType) - inputstream, coming from servletinputstream - we must read it out _now_ - toMemory: true->write it to memory (implemented), false->write it to tempfile (not implemented yet) |
Method Summary | |
---|---|
String |
getContentType()
Returns the content type of the file data contained within. |
int |
getFileLength()
Returns the length of the file representated by this FileHolder fileLength gets determinated either during "bufferInMemory" or "bufferInFile" (not impl. yet) |
String |
getFileName()
Returns the name that the file was stored with on the remote system, or null if the user didn't enter a file to be uploaded. |
InputStream |
getInputStreamFromBuffer()
DOCUMENT ME! |
void |
setFileName(String fileName)
Set the name of the file. |
void |
writeBufferToFile(File fileOrDirectory)
Writes out the the file in memory to disk. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileHolder(String fileName, org.apache.commons.fileupload.FileItem fileItem) throws IOException, IllegalArgumentException
fileName
- DOCUMENT ME!fileItem
- DOCUMENT ME!
IOException
- DOCUMENT ME!
IllegalArgumentException
- DOCUMENT ME!Method Detail |
---|
public String getContentType()
public int getFileLength()
Returns the length of the file representated by this FileHolder
fileLength gets determinated either during "bufferInMemory" or "bufferInFile" (not impl. yet)
public void setFileName(String fileName)
fileName
- DOCUMENT ME!public String getFileName()
null
if the user didn't enter a file to be uploaded. Note:
this is not the same as the name of the form parameter used to transmit
the file; that is available from the getName
method.
null
.Part#getName()
public InputStream getInputStreamFromBuffer() throws IOException
IOException
- DOCUMENT ME!public void writeBufferToFile(File fileOrDirectory) throws IOException
fileOrDirectory
- The file, or directory to write the file to. If
it is a directory, you must provide a file already.
IOException
- Thrown if there are rpoblems writing the file.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |